mirror of
https://github.com/benapetr/stikkit.git
synced 2025-04-26 04:51:09 -05:00
finished some more parameters
This commit is contained in:
parent
30eed46b4f
commit
f552105ce6
@ -62,7 +62,30 @@ bool TerminalParser::Parse()
|
|||||||
cerr << "Parameter -b requires an argument for it to work!" << endl;
|
cerr << "Parameter -b requires an argument for it to work!" << endl;
|
||||||
return true;
|
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);
|
text = text.substr(1);
|
||||||
}
|
}
|
||||||
valid = true;
|
valid = true;
|
||||||
@ -95,6 +118,9 @@ bool TerminalParser::ParseChar(char x)
|
|||||||
case 'h':
|
case 'h':
|
||||||
this->DisplayHelp();
|
this->DisplayHelp();
|
||||||
return true;
|
return true;
|
||||||
|
case 'p':
|
||||||
|
Configuration::Private = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,7 +132,8 @@ void TerminalParser::DisplayHelp()
|
|||||||
|
|
||||||
cout << "Stikkit - open source pastebin uploader for Stikked\n\n"\
|
cout << "Stikkit - open source pastebin uploader for Stikked\n\n"\
|
||||||
"Parameters:\n"\
|
"Parameters:\n"\
|
||||||
" -a <name>: Specify author name by default the current OS username is used\n"\
|
" -a <name>: Specify author name by default the current\n"\
|
||||||
|
" OS username is used\n"\
|
||||||
" -b <url>: Specify URL of Stikked server\n"\
|
" -b <url>: Specify URL of Stikked server\n"\
|
||||||
" -v: Increases verbosity\n"\
|
" -v: Increases verbosity\n"\
|
||||||
" -t <title>: Set a title for a paste\n"\
|
" -t <title>: Set a title for a paste\n"\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user