make -p and -s mutually exclusive

This commit is contained in:
filifa 2024-09-02 22:52:54 -05:00
parent ee984f7d72
commit 56d3c2c555
1 changed files with 4 additions and 2 deletions

View File

@ -127,6 +127,8 @@ func init() {
// Cobra also supports local flags, which will only run // Cobra also supports local flags, which will only run
// when this action is called directly. // when this action is called directly.
rootCmd.Flags().StringVarP(&preset, "preset", "p", "", "Preset file to use") rootCmd.Flags().StringVarP(&preset, "preset", "p", "", "preset file to use")
rootCmd.Flags().StringVarP(&scriptPath, "script", "s", "", "Script file to use") rootCmd.Flags().StringVarP(&scriptPath, "script", "s", "", "script file to use")
rootCmd.MarkFlagsMutuallyExclusive("preset", "script")
} }