bumped: (0.1.4) moved strings to an heade file

This commit is contained in:
Kaley, Fischer 2024-10-09 16:25:15 +02:00
parent ad2d685360
commit 532e3e408f
4 changed files with 28 additions and 25 deletions

View file

@ -1,6 +1,6 @@
pkgname=stc-git pkgname=stc-git
_gitname=stc _gitname=stc
pkgver=0.1.3 pkgver=0.1.4
pkgrel=1 pkgrel=1
pkgdesc="Easily download collections and mods from steam." pkgdesc="Easily download collections and mods from steam."
url="https://github.com/DRAGONTOS/stc" url="https://github.com/DRAGONTOS/stc"

View file

@ -1,3 +1,3 @@
{ {
"version": "0.1.3" "version": "0.1.4"
} }

22
src/includes/Strings.hpp Normal file
View file

@ -0,0 +1,22 @@
#pragma once
#include <string_view>
const std::string_view USAGE = R"#(usage: Steam Collector [flags] [<command> [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] [<command> [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.
)#";

View file

@ -10,6 +10,7 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
#include "includes/getHttp.h" #include "includes/getHttp.h"
#include "includes/Strings.hpp"
#include "regex" #include "regex"
std::string woof(std::ifstream &meow) { std::string woof(std::ifstream &meow) {
@ -18,26 +19,6 @@ std::string woof(std::ifstream &meow) {
return nya.str(); return nya.str();
} }
const std::string USAGE = R"#(usage: Steam Collector [flags] [<command> [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] [<command> [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) { int main(int argc, char **argv, char **envp) {
// need some cleaning in the future ata // need some cleaning in the future ata
@ -85,7 +66,7 @@ int main(int argc, char **argv, char **envp) {
// help msg // help msg
if (ARGS[i] == "-h") { if (ARGS[i] == "-h") {
if (argc < 3 || argv[2][0] == '-') { if (argc < 3 || argv[2][0] == '-') {
std::cerr << HELP.c_str(); std::cerr << HELP;
return 1; return 1;
} }
std::cout << HELP; std::cout << HELP;
@ -95,7 +76,7 @@ int main(int argc, char **argv, char **envp) {
// collectionid // collectionid
if (ARGS[i] == "-c") { if (ARGS[i] == "-c") {
if (argc < 3 || argv[2][0] == '-') { if (argc < 3 || argv[2][0] == '-') {
std::cerr << USAGE.c_str(); std::cerr << USAGE;
return 1; return 1;
} }
@ -150,7 +131,7 @@ int main(int argc, char **argv, char **envp) {
// modid // modid
if (ARGS[i] == "-m") { if (ARGS[i] == "-m") {
if (argc < 3 || argv[2][0] == '-') { if (argc < 3 || argv[2][0] == '-') {
std::cerr << USAGE.c_str(); std::cerr << USAGE;
return 1; return 1;
} }