diff options
| -rw-r--r-- | cli/cli.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -103,7 +103,7 @@ int cli_opt_long_set(struct cli_opt *self, const char *val) { struct cli_opt_long *opt = container_of(self, struct cli_opt_long, opt); - errno = 0; + errno = 0; char *endptr; opt->value = strtol(val, &endptr, 0); if (errno != 0 || *endptr != '\0') @@ -133,7 +133,7 @@ int cli_opt_ulong_set(struct cli_opt *self, const char *val) { struct cli_opt_ulong *opt = container_of(self, struct cli_opt_ulong, opt); - errno = 0; + errno = 0; char *endptr; opt->value = strtoul(val, &endptr, 0); if (errno != 0 || *endptr != '\0') @@ -267,8 +267,8 @@ static void explain_program(const struct cli *const cli) printf("%s\n", cli->header); printf("Usage: %s%s <command> [command options]\n\n", - cli->opts ? "[global options] " : "", - cli->binary); + cli->binary, + cli->opts ? " [global options]" : ""); if (cli->cmds) { puts("Commands:"); @@ -298,8 +298,8 @@ static void explain_command(const struct cli *const cli, printf("%s\n", cli->header); printf("Usage: %s%s %s %s\n\n", - cli->opts ? "[global options] " : "", cli->binary, + cli->opts ? " [global options]" : "", cmd->name, cmd->usage ?: "[options]"); printf("%s\n\n", cmd->help); |
