mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctlv3: handle a case of 0 arguments in put command
This commit is contained in:
parent
15c8876e4c
commit
674d54ad9b
@ -55,6 +55,10 @@ will store the content of the file to <key>.
|
||||
|
||||
// putCommandFunc executes the "put" command.
|
||||
func putCommandFunc(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
ExitWithError(ExitBadArgs, fmt.Errorf("put command needs 1 argument and input from stdin or 2 arguments."))
|
||||
}
|
||||
|
||||
key := []byte(args[0])
|
||||
value, err := argOrStdin(args, os.Stdin, 1)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user