make -p and -s mutually exclusive
This commit is contained in:
@@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user