feat: color in command line
This commit is contained in:
parent
13aa156214
commit
937a476743
|
@ -0,0 +1,17 @@
|
|||
#define RESET "\033[0m"
|
||||
#define BLACK "\033[30m" /* Black */
|
||||
#define RED "\033[31m" /* Red */
|
||||
#define GREEN "\033[32m" /* Green */
|
||||
#define YELLOW "\033[33m" /* Yellow */
|
||||
#define BLUE "\033[34m" /* Blue */
|
||||
#define MAGENTA "\033[35m" /* Magenta */
|
||||
#define CYAN "\033[36m" /* Cyan */
|
||||
#define WHITE "\033[37m" /* White */
|
||||
#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */
|
||||
#define BOLDRED "\033[1m\033[31m" /* Bold Red */
|
||||
#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */
|
||||
#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */
|
||||
#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */
|
||||
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
|
||||
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
|
||||
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */
|
8
main.cpp
8
main.cpp
|
@ -9,6 +9,8 @@
|
|||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "color.h"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
void displayHelp() {
|
||||
|
@ -29,11 +31,11 @@ void processFile(const fs::path& filePath) {
|
|||
crypt.Dump();
|
||||
crypt.FixMetadata();
|
||||
|
||||
std::cout << "Done: '" << crypt.dumpFilepath().string() << "'" << std::endl;
|
||||
std::cout << BOLDGREEN << "Done: '" << RESET << crypt.dumpFilepath().string() << "'" << std::endl;
|
||||
} catch (const std::invalid_argument& e) {
|
||||
std::cout << "Exception: '" << filePath << "'" << e.what() << std::endl;
|
||||
std::cerr << BOLDRED << "Exception: " << RESET << RED << e.what() << RESET << " '" << filePath.string() << "'" << std::endl;
|
||||
} catch (...) {
|
||||
std::cout << "Unexpected exception while processing file: " << filePath << std::endl;
|
||||
std::cerr << BOLDRED << "Unexpected exception while processing file: " << RESET << filePath.string() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue