From 532e3e408f16514faeecae17275c7b54a162cf19 Mon Sep 17 00:00:00 2001 From: DRAGONTOS Date: Wed, 9 Oct 2024 16:25:15 +0200 Subject: [PATCH] bumped: (0.1.4) moved strings to an heade file --- PKGBUILD | 2 +- props.json | 2 +- src/includes/Strings.hpp | 22 ++++++++++++++++++++++ src/main.cpp | 27 ++++----------------------- 4 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/includes/Strings.hpp diff --git a/PKGBUILD b/PKGBUILD index 5bb049e..d4fd7a7 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ pkgname=stc-git _gitname=stc -pkgver=0.1.3 +pkgver=0.1.4 pkgrel=1 pkgdesc="Easily download collections and mods from steam." url="https://github.com/DRAGONTOS/stc" diff --git a/props.json b/props.json index b7a6d98..04cf9c3 100644 --- a/props.json +++ b/props.json @@ -1,3 +1,3 @@ { - "version": "0.1.3" + "version": "0.1.4" } diff --git a/src/includes/Strings.hpp b/src/includes/Strings.hpp new file mode 100644 index 0000000..5a160f8 --- /dev/null +++ b/src/includes/Strings.hpp @@ -0,0 +1,22 @@ +#pragma once +#include + +const std::string_view USAGE = R"#(usage: Steam Collector [flags] [ [args]] +LISTING FLAGS: + -c: Install a collection. + -m: Install a specific mod. + -h: For the entire help msg. +)#"; + +const std::string_view HELP = R"#(usage: Steam Collector [flags] [ [args]] +LISTING FLAGS: + -c: Install a collection. + -m: Install a specific mod. + -h: For the entire help msg. + + LISTING ARGS: + 1: Should be the collectionid/modid. + 2: Could be the username if required. + 3: Could be the password if required. + 4: The dir to where you want to download the mods. +)#"; diff --git a/src/main.cpp b/src/main.cpp index 24c1fcf..611eed1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,6 +10,7 @@ #include #include #include "includes/getHttp.h" +#include "includes/Strings.hpp" #include "regex" std::string woof(std::ifstream &meow) { @@ -18,26 +19,6 @@ std::string woof(std::ifstream &meow) { return nya.str(); } -const std::string USAGE = R"#(usage: Steam Collector [flags] [ [args]] -LISTING FLAGS: - -c: Install a collection. - -m: Install a specific mod. - -h: For the entire help msg. -)#"; - -const std::string HELP = R"#(usage: Steam Collector [flags] [ [args]] -LISTING FLAGS: - -c: Install a collection. - -m: Install a specific mod. - -h: For the entire help msg. - - LISTING ARGS: - 1: Should be the collectionid/modid. - 2: Could be the username if required. - 3: Could be the password if required. - 4: The dir to where you want to download the mods. -)#"; - int main(int argc, char **argv, char **envp) { // need some cleaning in the future ata @@ -85,7 +66,7 @@ int main(int argc, char **argv, char **envp) { // help msg if (ARGS[i] == "-h") { if (argc < 3 || argv[2][0] == '-') { - std::cerr << HELP.c_str(); + std::cerr << HELP; return 1; } std::cout << HELP; @@ -95,7 +76,7 @@ int main(int argc, char **argv, char **envp) { // collectionid if (ARGS[i] == "-c") { if (argc < 3 || argv[2][0] == '-') { - std::cerr << USAGE.c_str(); + std::cerr << USAGE; return 1; } @@ -150,7 +131,7 @@ int main(int argc, char **argv, char **envp) { // modid if (ARGS[i] == "-m") { if (argc < 3 || argv[2][0] == '-') { - std::cerr << USAGE.c_str(); + std::cerr << USAGE; return 1; }