diff options
Diffstat (limited to 'src/help.c')
| -rw-r--r-- | src/help.c | 50 |
1 files changed, 28 insertions, 22 deletions
@@ -33,30 +33,32 @@ void help(void) { } flag_t; static const flag_t cmd_flags[] = { - {"-a", "--add", "[url]", "add a repo"}, - {"-b", "--build", "[path]", "build a package"}, - {"-d", "--declare", "", "install all packages"}, - {"-s", "--search", "[pkgs]", "find a package from your repos"}, - {"-i", "--install", "[pkgs, urls]", "install a package/repo"}, - {"-r", "--remove", "[pkgs]", "remove an installed package"}, - {"-l", "--list", "", "list all installed packages"}, - {"-u", "--update", "", "update all installed packages"}, - {"-h", "--help", "", "display this help message"}, - {"-v", "--version", "", "display version number"}, - {"-c", "--check", "", "run package checks"}, + {"-a", "--add", "[url]", "add a repo"}, + {"-b", "--build", "[path]", "build a package"}, + {"-d", "--declare", "", "install all packages"}, + {"-s", "--search", "[pkgs]", "find a package from your repos"}, + {"-i", "--install", "[pkgs, urls]", "install a package/repo"}, + {"-r", "--remove", "[pkgs]", "remove an installed package"}, + {"-l", "--list", "", "list all installed packages"}, + {"-u", "--update", "", "update all installed packages"}, + {"-h", "--help", "", "display this help message"}, + {"-v", "--version", "", "display version number"}, + {"-c", "--check", "", "run package checks"}, }; static const flag_t mod_flags[] = { - {"-q", "--quiet", "", "add a repo"}, - {"-f", "--force", "", "build a package"}, + {"-q", "--quiet", "", "add a repo"}, + {"-f", "--force", "", "build a package"}, }; - if (is_verbose) { + if (flags.verbose) { printf(BOLD_MAGENTA " , \n"); printf(BOLD_MAGENTA " / \\ \n"); printf(BOLD_MAGENTA "_.--' '--._ \n"); - printf(BOLD_MAGENTA "`'--, ,--'` " COLOR_RESET "pkgit " ITALIC GRAY "- package it!"COLOR_RESET"\n"); - printf(BOLD_YELLOW " _- " BOLD_MAGENTA "\\ /" BOLD_YELLOW " -_ " MAGENTA VERSION COLOR_RESET "\n"); + printf(BOLD_MAGENTA "`'--, ,--'` " COLOR_RESET "pkgit " ITALIC GRAY + "- package it!" COLOR_RESET "\n"); + printf(BOLD_YELLOW " _- " BOLD_MAGENTA "\\ /" BOLD_YELLOW + " -_ " MAGENTA VERSION COLOR_RESET "\n"); printf(BOLD_YELLOW "'-_ " BOLD_MAGENTA "'" BOLD_YELLOW " _-' \n"); printf(BOLD_YELLOW " `'-.-'` " COLOR_RESET "\n"); } else { @@ -66,14 +68,18 @@ void help(void) { printf("\n"); printf(RED "subcommand flags" COLOR_RESET ":\n"); - for (size_t i = 0; i < sizeof(cmd_flags)/sizeof(cmd_flags[0]); i++) { - printf(COLOR_RESET "\t" GREEN "%-2s" COLOR_RESET ", " YELLOW "%-12s" BLUE "%-16s" GRAY "# %s\n" COLOR_RESET, - cmd_flags[i].short_flag, cmd_flags[i].long_flag, cmd_flags[i].arg, cmd_flags[i].desc); + for (size_t i = 0; i < sizeof(cmd_flags) / sizeof(cmd_flags[0]); i++) { + printf(COLOR_RESET "\t" GREEN "%-2s" COLOR_RESET ", " YELLOW + "%-12s" BLUE "%-16s" GRAY "# %s\n" COLOR_RESET, + cmd_flags[i].short_flag, cmd_flags[i].long_flag, + cmd_flags[i].arg, cmd_flags[i].desc); } printf("\n" RED "modifier flags" COLOR_RESET ":\n"); - for (size_t i = 0; i < sizeof(mod_flags)/sizeof(mod_flags[0]); i++) { - printf(COLOR_RESET "\t" GREEN "%-2s" COLOR_RESET ", " YELLOW "%-12s" BLUE "%-16s" GRAY "# %s\n" COLOR_RESET, - mod_flags[i].short_flag, mod_flags[i].long_flag, mod_flags[i].arg, mod_flags[i].desc); + for (size_t i = 0; i < sizeof(mod_flags) / sizeof(mod_flags[0]); i++) { + printf(COLOR_RESET "\t" GREEN "%-2s" COLOR_RESET ", " YELLOW + "%-12s" BLUE "%-16s" GRAY "# %s\n" COLOR_RESET, + mod_flags[i].short_flag, mod_flags[i].long_flag, + mod_flags[i].arg, mod_flags[i].desc); } } |
