Some formatting changes.
Added background colors and colored some of the prompts. Very minor update, just want to get this one out.master
parent
b742db9cda
commit
74e8427f89
|
@ -3,9 +3,9 @@
|
|||
int usage() {
|
||||
std::cout << "Usage:";
|
||||
std::cout << "\n\t";
|
||||
std::cout << program_invocation_short_name << " [command] <options>\n";
|
||||
std::cout << program_invocation_short_name << " [" << cyan("command") << "] <" << bright_green("options") << ">\n";
|
||||
std::cout << "\n";
|
||||
std::cout << "Run `" << program_invocation_short_name << " --help' for more information.\n" << std::endl;
|
||||
std::cout << "Run `" << program_invocation_short_name << bright_green(" --help") << "' for more information.\n" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -106,6 +106,6 @@ int main(int argc, char **argv) {
|
|||
kw = a1.substr(2);
|
||||
if (kw == "help") return show_help();
|
||||
}
|
||||
std::cerr << "ERROR: Unknown command `" << a1 << "'\n" << std::endl;
|
||||
std::cerr << bg_red(bold("ERROR")) << ": Unknown command `" << bright_magenta(a1) << "'\n" << std::endl;
|
||||
return usage();
|
||||
}
|
102
src/colors.cc
102
src/colors.cc
|
@ -4,66 +4,72 @@ void colors_test() {
|
|||
std::cout << "Hello World";
|
||||
}
|
||||
|
||||
std::string black(std::string input) {
|
||||
return "\x1b[30m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string black(std::string input) {return "\x1b[30m" + input + "\x1b[0m";}
|
||||
|
||||
std::string red(std::string input) {
|
||||
return "\x1b[31m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string red(std::string input) {return "\x1b[31m" + input + "\x1b[0m";}
|
||||
|
||||
std::string green(std::string input) {
|
||||
return "\x1b[32m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string green(std::string input) {return "\x1b[32m" + input + "\x1b[0m";}
|
||||
|
||||
std::string yellow(std::string input) {
|
||||
return "\x1b[33m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string yellow(std::string input) {return "\x1b[33m" + input + "\x1b[0m";}
|
||||
|
||||
std::string blue(std::string input) {
|
||||
return "\x1b[34m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string blue(std::string input) {return "\x1b[34m" + input + "\x1b[0m";}
|
||||
|
||||
std::string magenta(std::string input) {
|
||||
return "\x1b[35m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string magenta(std::string input) {return "\x1b[35m" + input + "\x1b[0m";}
|
||||
|
||||
std::string cyan(std::string input) {
|
||||
return "\x1b[36m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string cyan(std::string input) {return "\x1b[36m" + input + "\x1b[0m";}
|
||||
|
||||
std::string white(std::string input) {
|
||||
return "\x1b[37m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string white(std::string input) {return "\x1b[37m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_black(std::string input) {
|
||||
return "\x1b[90m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_black(std::string input) {return "\x1b[90m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_red(std::string input) {
|
||||
return "\x1b[91m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_red(std::string input) {return "\x1b[91m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_green(std::string input) {
|
||||
return "\x1b[92m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_green(std::string input) {return "\x1b[92m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_yellow(std::string input) {
|
||||
return "\x1b[93m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_yellow(std::string input) {return "\x1b[93m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_blue(std::string input) {
|
||||
return "\x1b[94m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_blue(std::string input) {return "\x1b[94m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_magenta(std::string input) {
|
||||
return "\x1b[95m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_magenta(std::string input) {return "\x1b[95m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_cyan(std::string input) {
|
||||
return "\x1b[96m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_cyan(std::string input) {return "\x1b[96m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bright_white(std::string input) {
|
||||
return "\x1b[97m" + input + "\x1b[0m";
|
||||
}
|
||||
std::string bright_white(std::string input) {return "\x1b[97m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_black(std::string input) {return "\x1b[40m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_red(std::string input) {return "\x1b[41m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_green(std::string input) {return "\x1b[42m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_yellow(std::string input) {return "\x1b[43m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_blue(std::string input) {return "\x1b[44m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_magenta(std::string input) {return "\x1b[45m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_cyan(std::string input) {return "\x1b[46m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_white(std::string input) {return "\x1b[47m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_black(std::string input) {return "\x1b[100m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_red(std::string input) {return "\x1b[101m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_green(std::string input) {return "\x1b[102m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_yellow(std::string input) {return "\x1b[103m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_blue(std::string input) {return "\x1b[104m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_magenta(std::string input) {return "\x1b[105m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_cyan(std::string input) {return "\x1b[106m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bg_bright_white(std::string input) {return "\x1b[107m" + input + "\x1b[0m";}
|
||||
|
||||
std::string bold(std::string input) {return "\x1b[1m" + input + "\x1b[0m";}
|
||||
|
||||
std::string underline(std::string input) {return "\x1b[4m" + input + "\x1b[0m";}
|
||||
|
||||
std::string reverse(std::string input) {return "\x1b[7m" + input + "\x1b[0m";}
|
21
src/colors.h
21
src/colors.h
|
@ -19,4 +19,23 @@ std::string bright_yellow(std::string input);
|
|||
std::string bright_blue(std::string input);
|
||||
std::string bright_magenta(std::string input);
|
||||
std::string bright_cyan(std::string input);
|
||||
std::string bright_white(std::string input);
|
||||
std::string bright_white(std::string input);
|
||||
std::string bg_black(std::string input);
|
||||
std::string bg_red(std::string input);
|
||||
std::string bg_green(std::string input);
|
||||
std::string bg_yellow(std::string input);
|
||||
std::string bg_blue(std::string input);
|
||||
std::string bg_magenta(std::string input);
|
||||
std::string bg_cyan(std::string input);
|
||||
std::string bg_white(std::string input);
|
||||
std::string bg_bright_black(std::string input);
|
||||
std::string bg_bright_red(std::string input);
|
||||
std::string bg_bright_green(std::string input);
|
||||
std::string bg_bright_yellow(std::string input);
|
||||
std::string bg_bright_blue(std::string input);
|
||||
std::string bg_bright_magenta(std::string input);
|
||||
std::string bg_bright_cyan(std::string input);
|
||||
std::string bg_bright_white(std::string input);
|
||||
std::string bold(std::string input);
|
||||
std::string underline(std::string input);
|
||||
std::string reverse(std::string input);
|
Loading…
Reference in New Issue