cmd: fix extra comma after command name in usage help message
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include <blue/cmd.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <blue/term.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -313,20 +312,20 @@ static void get_command_string(struct b_command *cmd, b_string *out)
|
||||
r++;
|
||||
}
|
||||
|
||||
if (r == 1) {
|
||||
b_string_append_cstr(out, ", ");
|
||||
}
|
||||
|
||||
if (cmd->b_short_name) {
|
||||
if (r > 0) {
|
||||
b_string_append_cstr(out, ", ");
|
||||
}
|
||||
|
||||
b_string_append_cstrf(out, F_GREEN "-%c" F_RESET, cmd->b_short_name);
|
||||
r++;
|
||||
}
|
||||
|
||||
if (r == 2) {
|
||||
b_string_append_cstr(out, ", ");
|
||||
}
|
||||
|
||||
if (cmd->b_long_name) {
|
||||
if (r > 0) {
|
||||
b_string_append_cstr(out, ", ");
|
||||
}
|
||||
|
||||
b_string_append_cstrf(out, F_GREEN "--%s" F_RESET, cmd->b_long_name);
|
||||
r++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user