add help menu to put command when no parameters are present (#4852)

This commit is contained in:
Sveinn
2024-02-21 18:35:53 -08:00
committed by GitHub
parent 5ff2208a2d
commit e6288fa5f3
+5 -1
View File
@@ -77,6 +77,11 @@ EXAMPLES:
// mainPut is the entry point for put command.
func mainPut(cliCtx *cli.Context) error {
args := cliCtx.Args()
if len(args) < 2 {
showCommandHelpAndExit(cliCtx, 1) // last argument is exit code.
}
ctx, cancelPut := context.WithCancel(globalContext)
defer cancelPut()
// part size
@@ -97,7 +102,6 @@ func mainPut(cliCtx *cli.Context) error {
encKeyDB, err := getEncKeys(cliCtx)
fatalIf(err, "Unable to parse encryption keys.")
args := cliCtx.Args()
if len(args) < 2 {
fatalIf(errInvalidArgument().Trace(args...), "Invalid number of arguments.")
}