Commit 7fc14171 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

blobcli: print usage when run without arguments



Previously, running blobcli with no arguments would just print
"ERROR: Invalid option" and exit; tweak the tests in usage() so the
command help gets printed in this case.

Change-Id: I70dbe82f2e83a6f068d4bd61c7baa9d2bbc6f829
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398078


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent cf9e0998
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ usage(struct cli_context_t *cli_context, char *msg)
		printf("%s", msg);
	}

	if (cli_context && cli_context->cli_mode == CLI_MODE_CMD) {
	if (!cli_context || cli_context->cli_mode == CLI_MODE_CMD) {
		printf("Version %s\n", SPDK_VERSION_STRING);
		printf("Usage: %s [-c SPDK config_file] Command\n", program_name);
		printf("\n%s is a command line tool for interacting with blobstore\n",
@@ -181,7 +181,7 @@ usage(struct cli_context_t *cli_context, char *msg)
		printf("on the underlying device specified in the conf file passed\n");
		printf("in as a command line option.\n");
	}
	if (cli_context && cli_context->cli_mode != CLI_MODE_SCRIPT) {
	if (!cli_context || cli_context->cli_mode != CLI_MODE_SCRIPT) {
		print_cmds();
	}
}