Skip to content

Commit af1f6e4

Browse files
committed
usage: remove exec_path parameter
Unneeded, ug_argv and ug_argv[0] already set so the nullptr check is also unnecessary.
1 parent 8c0a79c commit af1f6e4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ print_help_item(const string &name, initializer_list<string> help)
222222
cout << "\n";
223223
}
224224

225-
static void usage(const char *exec_path, bool full = false)
225+
static void
226+
usage(bool full = false)
226227
{
227-
col() << "Usage: " << SBOLD(SRED((exec_path ? exec_path : "<executable_path>")) << " [options] address\n\n");
228+
col() << "Usage: " << SBOLD(SRED((uv_argv[0])) << " [options] address\n\n");
228229
printf("Options:\n");
229230
print_help_item("-h | -H, --fullhelp", {"show usage (basic/full)"});
230231
print_help_item("-d <display_device>", {"select display device, use '-d help'",
@@ -862,7 +863,7 @@ parse_options_internal(int argc, char *argv[], struct ug_options *opt)
862863
}
863864
break;
864865
case 'h':
865-
usage(uv_argv[0], false);
866+
usage(false);
866867
return 1;
867868
case 'P':
868869
if (!parse_port(optarg, opt)) {
@@ -911,7 +912,7 @@ parse_options_internal(int argc, char *argv[], struct ug_options *opt)
911912
opt->audio.echo_cancellation = true;
912913
break;
913914
case 'H':
914-
usage(uv_argv[0], true);
915+
usage(true);
915916
return 1;
916917
case 'D':
917918
if (int ret = parse_cuda_device(optarg)) {

0 commit comments

Comments
 (0)