update: added some namespaces
This commit is contained in:
parent
782d29aec4
commit
ac0645956f
1 changed files with 8 additions and 5 deletions
13
src/main.cpp
13
src/main.cpp
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace cpptoml;
|
using namespace cpptoml;
|
||||||
|
using namespace filesystem;
|
||||||
|
|
||||||
const string USAGE = R"#(usage: RapidMenu [flags] [<command> [args]]
|
const string USAGE = R"#(usage: RapidMenu [flags] [<command> [args]]
|
||||||
LISTING COMMANDS:
|
LISTING COMMANDS:
|
||||||
|
@ -52,27 +53,29 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
if (argc > 1 && strcmp(argv[1], "-c") == 0) {
|
if (argc > 1 && strcmp(argv[1], "-c") == 0) {
|
||||||
if (argc < 3 || argv[2][0] == '-') {
|
if (argc < 3 || argv[2][0] == '-') {
|
||||||
std::cerr << USAGE.c_str() << std::endl;
|
cerr << USAGE.c_str() << endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
configFile = argv[2];
|
configFile = argv[2];
|
||||||
|
|
||||||
} else if (argc > 1 && strcmp(argv[1], "-d") == 0) {
|
} else if (argc > 1 && strcmp(argv[1], "-d") == 0) {
|
||||||
std::cerr << USAGE.c_str() << std::endl;
|
cerr << USAGE.c_str() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}else{
|
}else{
|
||||||
std::cerr << USAGE.c_str() << std::endl;
|
cerr << USAGE.c_str() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configFile) {
|
if (configFile) {
|
||||||
|
cerr << USAGE.c_str() << endl;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* userHome = getenv("HOME");
|
const char* userHome = getenv("HOME");
|
||||||
|
|
||||||
string rapidMenuPath = string(userHome) + "/.config/RapidMenu";
|
string rapidMenuPath = string(userHome) + "/.config/RapidMenu";
|
||||||
|
|
||||||
if (filesystem::exists(rapidMenuPath) && filesystem::is_directory(rapidMenuPath)) {
|
if (exists(rapidMenuPath) && is_directory(rapidMenuPath)) {
|
||||||
} else {
|
} else {
|
||||||
system("mkdir -p /home/$USER/.config/RapidMenu");
|
system("mkdir -p /home/$USER/.config/RapidMenu");
|
||||||
cerr << "Setting up config." << endl;
|
cerr << "Setting up config." << endl;
|
||||||
|
|
Loading…
Add table
Reference in a new issue