mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 21:26:17 +00:00
Throw if file and args secrets are used on secret set command
This commit is contained in:
@@ -145,7 +145,10 @@ var secretsSetCmd = &cobra.Command{
|
|||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
if cmd.Flags().Changed("file") {
|
if cmd.Flags().Changed("file") {
|
||||||
return cobra.ExactArgs(0)(cmd, args)
|
if len(args) > 0 {
|
||||||
|
return fmt.Errorf("secrets cannot be provided as command-line arguments when the --file option is used. Please choose either file-based or argument-based secret input")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
return cobra.MinimumNArgs(1)(cmd, args)
|
return cobra.MinimumNArgs(1)(cmd, args)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user