fix(cli): correct output messages in the update menu
This commit is contained in:
parent
092188ac5e
commit
3939b30c15
10
cli/cli.c
10
cli/cli.c
@ -305,7 +305,7 @@ int menu_upd_sasa(const char *arg) {
|
||||
uint64_t sasa_id = strtoull(arg, &endptr, 16);
|
||||
if (*endptr == 0) {
|
||||
char *path = malloc(4096);
|
||||
printf(HIGHLIGHT("Enter the new file path (leave empty to keep current)\n"));
|
||||
printf(HIGHLIGHT("Enter the new file path (leave blank to keep current)\n"));
|
||||
fgets(path, 4096, stdin);
|
||||
if (*path == '\n') {
|
||||
free(path);
|
||||
@ -334,7 +334,7 @@ int menu_upd_tanzaku(const char *arg) {
|
||||
uint64_t tanzaku_id = strtoull(arg, &endptr, 16);
|
||||
if (*endptr == 0) {
|
||||
char *name = malloc(4096), *description = malloc(4096);
|
||||
printf(HIGHLIGHT("Enter the new name of tanzaku (leave empty to keep current)\n"));
|
||||
printf(HIGHLIGHT("Enter the new name of tanzaku (leave blank to keep current)\n"));
|
||||
fgets(name, 4096, stdin);
|
||||
if (*name == '\n') {
|
||||
free(name);
|
||||
@ -342,7 +342,7 @@ int menu_upd_tanzaku(const char *arg) {
|
||||
} else {
|
||||
name[strlen(name) - 1] = 0;
|
||||
}
|
||||
printf(HIGHLIGHT("Enter the new description of tanzaku (leave empty to keep current)\n"));
|
||||
printf(HIGHLIGHT("Enter the new description of tanzaku (leave blank to keep current)\n"));
|
||||
fgets(description, 4096, stdin);
|
||||
if (*description == '\n') {
|
||||
free(description);
|
||||
@ -352,10 +352,10 @@ int menu_upd_tanzaku(const char *arg) {
|
||||
}
|
||||
if (tanabata_tanzaku_upd(&tanabata, tanzaku_id, name, description) == 0 &&
|
||||
tanabata_save(&tanabata) == 0) {
|
||||
printf(SUCCESS("Successfully updated sasa\n"));
|
||||
printf(SUCCESS("Successfully updated tanzaku\n"));
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, ERROR("Failed to update sasa\n"));
|
||||
fprintf(stderr, ERROR("Failed to update tanzaku\n"));
|
||||
return 1;
|
||||
}
|
||||
fprintf(stderr, ERROR("Invalid ID\n"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user