diff --git a/cclock b/cclock index dd001a8..78ccf25 100755 Binary files a/cclock and b/cclock differ diff --git a/cclock.c b/cclock.c index f17d789..49546d1 100644 --- a/cclock.c +++ b/cclock.c @@ -151,6 +151,19 @@ for (int i = 1; i < argc; i++) { case 'h': goto show_help; + 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; + default: printf("Unknown flag: -%c\n", argv[i][j]); return 1; @@ -165,9 +178,14 @@ char config_path[512]; snprintf(config_path, sizeof(config_path), "%s/.config/cclock/config", getenv("HOME")); if (!load_config_toml(&cfg, config_path)) { + hide_temp = true; printf("Failed to load config from %s\n", config_path); - return 1; } +/* WORK IN PROGRESS CUSTOM_CONFIG +else if (custom_config = true) { + snprintf(config_path, sizeof(config_path), "%s/.config/cclock/config", getenv("HOME")); +}*/ + /* NOW apply overrides */ @@ -209,6 +227,9 @@ for (int i = 1; i < argc; i++) { quiet = true; break; + /*case 'c': + goto custom_config;*/ + case 'h': goto show_help; @@ -294,18 +315,5 @@ for (int i = 1; i < argc; i++) { curl_global_cleanup(); 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; }