diff --git a/stikkit/terminalparser.cpp b/stikkit/terminalparser.cpp index 231f57f..224a84f 100644 --- a/stikkit/terminalparser.cpp +++ b/stikkit/terminalparser.cpp @@ -62,7 +62,30 @@ bool TerminalParser::Parse() cerr << "Parameter -b requires an argument for it to work!" << endl; return true; } + } else if (text.at(0) == 't') + { + if (this->argc > x + 1 && !this->argv[x + 1][0] != '-') + { + x++; + Configuration::Title = this->argv[x]; + } else + { + cerr << "Parameter -b requires an argument for it to work!" << endl; + return true; + } + } else if (text.at(0) == 'e') + { + if (this->argc > x + 1 && !this->argv[x + 1][0] != '-') + { + x++; + Configuration::Expiry = this->argv[x]; + } else + { + cerr << "Parameter -b requires an argument for it to work!" << endl; + return true; + } } + text = text.substr(1); } valid = true; @@ -95,6 +118,9 @@ bool TerminalParser::ParseChar(char x) case 'h': this->DisplayHelp(); return true; + case 'p': + Configuration::Private = true; + return false; } return false; } @@ -106,7 +132,8 @@ void TerminalParser::DisplayHelp() cout << "Stikkit - open source pastebin uploader for Stikked\n\n"\ "Parameters:\n"\ - " -a : Specify author name by default the current OS username is used\n"\ + " -a : Specify author name by default the current\n"\ + " OS username is used\n"\ " -b : Specify URL of Stikked server\n"\ " -v: Increases verbosity\n"\ " -t : Set a title for a paste\n"\