fix: removed some useless stuff
This commit is contained in:
parent
f0ac23ac29
commit
e9f7d5acda
1 changed files with 4 additions and 16 deletions
20
src/main.cpp
20
src/main.cpp
|
@ -26,24 +26,15 @@ const string invalidconfig = R"#(Not a valid config: )#";
|
||||||
|
|
||||||
|
|
||||||
struct Action {
|
struct Action {
|
||||||
string rnames;
|
|
||||||
string rdescription;
|
|
||||||
string rcommand;
|
|
||||||
string names;
|
string names;
|
||||||
string description;
|
string description;
|
||||||
string command;
|
string command;
|
||||||
|
|
||||||
Action(
|
Action(
|
||||||
const string& rnms = "",
|
|
||||||
const string& rdesc = "",
|
|
||||||
const string& rcmd = "",
|
|
||||||
const string& nms = "",
|
const string& nms = "",
|
||||||
const string& desc = "",
|
const string& desc = "",
|
||||||
const string& cmd = "")
|
const string& cmd = "")
|
||||||
:
|
:
|
||||||
rnames(rnms),
|
|
||||||
rdescription(rdesc),
|
|
||||||
rcommand(rcmd),
|
|
||||||
names(nms),
|
names(nms),
|
||||||
description(desc),
|
description(desc),
|
||||||
command(cmd) {}
|
command(cmd) {}
|
||||||
|
@ -51,9 +42,6 @@ struct Action {
|
||||||
|
|
||||||
void from_toml(const table& t, Action& a) {
|
void from_toml(const table& t, Action& a) {
|
||||||
try {
|
try {
|
||||||
a.rnames = *t.get_as<string>("rnames");
|
|
||||||
a.rdescription = *t.get_as<string>("rdescription");
|
|
||||||
a.rcommand = *t.get_as<string>("rcommand");
|
|
||||||
a.names = *t.get_as<string>("names");
|
a.names = *t.get_as<string>("names");
|
||||||
a.description = *t.get_as<string>("description");
|
a.description = *t.get_as<string>("description");
|
||||||
a.command = *t.get_as<string>("command");
|
a.command = *t.get_as<string>("command");
|
||||||
|
@ -63,10 +51,10 @@ void from_toml(const table& t, Action& a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
const char* configFile = nullptr;
|
const char* configFile = nullptr;
|
||||||
const char* userHome = getenv("HOME");
|
const char* userHome = getenv("HOME");
|
||||||
string rapidMenuPath = string(userHome) + "/.config/RapidMenu";
|
string rapidMenuPath = string(userHome) + "/.config/RapidMenu";
|
||||||
string rapidcommand = "mkdir -p " + rapidMenuPath;
|
string rapidcommand = "mkdir -p " + rapidMenuPath;
|
||||||
|
|
||||||
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] == '-') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue