diff --git a/src/includes/Regex.hpp b/src/includes/Regex.hpp index 291ce57..af83a1b 100644 --- a/src/includes/Regex.hpp +++ b/src/includes/Regex.hpp @@ -16,7 +16,7 @@ std::string pass; std::string gameid; std::string dir; -int ab = 0; +bool ab = false; // slashing int slashtp = 0; diff --git a/src/main.cpp b/src/main.cpp index 72f2a6d..ff33416 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,7 +58,6 @@ int main(int argc, char **argv, char **envp) { inputCmd.dir = ARGS[1 + 5]; } - inputCmd.ab = 0; try { getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid}); } catch (std::string &meow) { @@ -78,7 +77,6 @@ int main(int argc, char **argv, char **envp) { inputCmd.dir = ARGS[1 + 3]; } - inputCmd.ab = 0; try { getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid}); } catch (std::string &meow) { @@ -111,7 +109,7 @@ int main(int argc, char **argv, char **envp) { inputCmd.dir = ARGS[1 + 5]; } - inputCmd.ab = 1; + inputCmd.ab = true; break; } @@ -124,7 +122,7 @@ int main(int argc, char **argv, char **envp) { inputCmd.dir = ARGS[1 + 3]; } - inputCmd.ab = 1; + inputCmd.ab = true; break; } else { std::cerr << HELP; diff --git a/src/maincommand.cpp b/src/maincommand.cpp index 8d29121..74b9b87 100644 --- a/src/maincommand.cpp +++ b/src/maincommand.cpp @@ -56,7 +56,7 @@ void showLoadingCursor(std::atomic& running) { } void maincommand(cmd *inputCmd) { - std::string idsm = (inputCmd->ab == 1) ? R"( +workshop_download_item )" + inputCmd->gameid + " " + inputCmd->modid + " +quit": R"()"; + std::string idsm = R"( +workshop_download_item )" + inputCmd->gameid + " " + inputCmd->modid + " +quit"; std::string maincommand2 = std::string{"sh ~/Steam/steamcmd.sh +force_install_dir " + inputCmd->dir @@ -64,7 +64,7 @@ void maincommand(cmd *inputCmd) { + inputCmd->user + ((inputCmd->pass.empty()) ? "" : inputCmd->pass) + " " - + ((inputCmd->ab == 1) ? idsm: inputCmd->ids)}.c_str(); + + ((inputCmd->ab == true) ? idsm: inputCmd->ids)}.c_str(); try { std::atomic running(true); @@ -78,8 +78,8 @@ void maincommand(cmd *inputCmd) { } // mod or collection? - std::string total = (!inputCmd->modid.empty()) ? "Total: 1" : "Total: " + std::to_string(inputCmd->slashtp -1) + "\n"; - std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)"; + std::string total = (inputCmd->ab == true) ? "Total: 1" : "Total: " + std::to_string(inputCmd->slashtp -1) + "\n"; + std::string colm = (inputCmd->ab == true) ? R"(Mod)" : R"(Collection)"; // shows how much and what has downloaded std::string mods = total