@@ -27,17 +27,17 @@ func newSecretCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
2727 }
2828
2929 cmd := & cobra.Command {
30- Use : "create [OPTIONS] SECRET" ,
30+ Use : "create [OPTIONS] SECRET file|- " ,
3131 Short : "Create a secret from a file or STDIN as content" ,
32- Args : cli .ExactArgs (1 ),
32+ Args : cli .ExactArgs (2 ),
3333 RunE : func (cmd * cobra.Command , args []string ) error {
3434 createOpts .name = args [0 ]
35+ createOpts .file = args [1 ]
3536 return runSecretCreate (dockerCli , createOpts )
3637 },
3738 }
3839 flags := cmd .Flags ()
3940 flags .VarP (& createOpts .labels , "label" , "l" , "Secret labels" )
40- flags .StringVarP (& createOpts .file , "file" , "f" , "" , "Read from a file or STDIN ('-')" )
4141
4242 return cmd
4343}
@@ -46,10 +46,6 @@ func runSecretCreate(dockerCli *command.DockerCli, options createOptions) error
4646 client := dockerCli .Client ()
4747 ctx := context .Background ()
4848
49- if options .file == "" {
50- return fmt .Errorf ("Please specify either a file name or STDIN ('-') with --file" )
51- }
52-
5349 var in io.Reader = dockerCli .In ()
5450 if options .file != "-" {
5551 file , err := system .OpenSequential (options .file )
0 commit comments