fix: made formatting a bit better

This commit is contained in:
Kaley, Fischer 2024-10-22 16:35:36 +02:00
parent 1b015de156
commit 220fab1f22
3 changed files with 7 additions and 9 deletions

View file

@ -16,7 +16,7 @@ std::string pass;
std::string gameid; std::string gameid;
std::string dir; std::string dir;
int ab = 0; bool ab = false;
// slashing // slashing
int slashtp = 0; int slashtp = 0;

View file

@ -58,7 +58,6 @@ int main(int argc, char **argv, char **envp) {
inputCmd.dir = ARGS[1 + 5]; inputCmd.dir = ARGS[1 + 5];
} }
inputCmd.ab = 0;
try { try {
getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid}); getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid});
} catch (std::string &meow) { } catch (std::string &meow) {
@ -78,7 +77,6 @@ int main(int argc, char **argv, char **envp) {
inputCmd.dir = ARGS[1 + 3]; inputCmd.dir = ARGS[1 + 3];
} }
inputCmd.ab = 0;
try { try {
getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid}); getHttp(&inputCmd, std::string{"https://steamcommunity.com/sharedfiles/filedetails/?id=" + inputCmd.collectionid});
} catch (std::string &meow) { } catch (std::string &meow) {
@ -111,7 +109,7 @@ int main(int argc, char **argv, char **envp) {
inputCmd.dir = ARGS[1 + 5]; inputCmd.dir = ARGS[1 + 5];
} }
inputCmd.ab = 1; inputCmd.ab = true;
break; break;
} }
@ -124,7 +122,7 @@ int main(int argc, char **argv, char **envp) {
inputCmd.dir = ARGS[1 + 3]; inputCmd.dir = ARGS[1 + 3];
} }
inputCmd.ab = 1; inputCmd.ab = true;
break; break;
} else { } else {
std::cerr << HELP; std::cerr << HELP;

View file

@ -56,7 +56,7 @@ void showLoadingCursor(std::atomic<bool>& running) {
} }
void maincommand(cmd *inputCmd) { 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 " std::string maincommand2 = std::string{"sh ~/Steam/steamcmd.sh +force_install_dir "
+ inputCmd->dir + inputCmd->dir
@ -64,7 +64,7 @@ void maincommand(cmd *inputCmd) {
+ inputCmd->user + inputCmd->user
+ ((inputCmd->pass.empty()) ? "" : inputCmd->pass) + ((inputCmd->pass.empty()) ? "" : inputCmd->pass)
+ " " + " "
+ ((inputCmd->ab == 1) ? idsm: inputCmd->ids)}.c_str(); + ((inputCmd->ab == true) ? idsm: inputCmd->ids)}.c_str();
try { try {
std::atomic<bool> running(true); std::atomic<bool> running(true);
@ -78,8 +78,8 @@ void maincommand(cmd *inputCmd) {
} }
// mod or collection? // mod or collection?
std::string total = (!inputCmd->modid.empty()) ? "Total: 1" : "Total: " + std::to_string(inputCmd->slashtp -1) + "\n"; std::string total = (inputCmd->ab == true) ? "Total: 1" : "Total: " + std::to_string(inputCmd->slashtp -1) + "\n";
std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)"; std::string colm = (inputCmd->ab == true) ? R"(Mod)" : R"(Collection)";
// shows how much and what has downloaded // shows how much and what has downloaded
std::string mods = total std::string mods = total