fixed goto placement
This commit is contained in:
parent
9c6b92372b
commit
474108c975
2 changed files with 14 additions and 18 deletions
BIN
cclock
BIN
cclock
Binary file not shown.
32
cclock.c
32
cclock.c
|
|
@ -158,22 +158,6 @@ for (int i = 1; i < argc; i++) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Help/Usage output */
|
|
||||||
show_help:
|
|
||||||
|
|
||||||
printf("Usage: %s [-HqTtCF]\n\n", argv[0]);
|
|
||||||
|
|
||||||
printf("Options:\n");
|
|
||||||
printf(" -t Use 12-hour time format\n");
|
|
||||||
printf(" -H Human-readable date (\"Tuesday 16, Feb\")\n");
|
|
||||||
printf(" -q Hide \"Press q to quit\" footer\n");
|
|
||||||
printf(" -T Hide temperature display\n");
|
|
||||||
printf(" -C Force Celsius\n");
|
|
||||||
printf(" -F Force Fahrenheit\n");
|
|
||||||
printf(" -h,--help Show this help\n");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* NOW load config */
|
/* NOW load config */
|
||||||
|
|
||||||
config_t cfg = {0};
|
config_t cfg = {0};
|
||||||
|
|
@ -226,8 +210,7 @@ for (int i = 1; i < argc; i++) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
printf("Usage: %s [-tH]\n", argv[0]);
|
goto show_help;
|
||||||
return 0;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("Unknown flag: -%c\n", argv[i][j]);
|
printf("Unknown flag: -%c\n", argv[i][j]);
|
||||||
|
|
@ -311,5 +294,18 @@ for (int i = 1; i < argc; i++) {
|
||||||
|
|
||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
|
/* Help/Usage output */
|
||||||
|
show_help:
|
||||||
|
|
||||||
|
printf("Usage: %s [-HqTtCF]\n\n", argv[0]);
|
||||||
|
printf("Options:\n");
|
||||||
|
printf(" -t Use 12-hour time format\n");
|
||||||
|
printf(" -H Human-readable date (\"Tuesday 16, Feb\")\n");
|
||||||
|
printf(" -q Hide \"Press q to quit\" footer\n");
|
||||||
|
printf(" -T Hide temperature display\n");
|
||||||
|
printf(" -C Force Celsius\n");
|
||||||
|
printf(" -F Force Fahrenheit\n");
|
||||||
|
printf(" -h,--help Show this help\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue