git-svn-id: svn://db.shs.com.ru/pip@919 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -3,39 +3,35 @@
|
||||
|
||||
using namespace PICoutManipulators;
|
||||
|
||||
PIString ip = "0.0.0.0";
|
||||
int port = 10101;
|
||||
|
||||
void usage() {
|
||||
piCout << Bold << "PIP Cloud dispatcher";
|
||||
piCout << Bold << "PIP Cloud Dispatcher";
|
||||
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"picloud\"" << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"picloud [-h] [-i <ip>] [-p <port>]\"" << NewLine;
|
||||
piCout << Green << Bold << "Details:";
|
||||
piCout << "-h --help " << Green << "- display this message and exit";
|
||||
//piCout << "-g --genhash " << Green << "- generate hash from <pass> string";
|
||||
//piCout << "-t --text " << Green << "- output in text base64";
|
||||
//piCout << "-o --out <out_file> " << Green << "- write out to file <out_file>";
|
||||
//piCout << "-c --crypt <file> " << Green << "- crypt file <file> using secret <pass> or <hash> or <key_file>";
|
||||
//piCout << "-d --decrypt <file> " << Green << "- decrypt file <file> using secret <pass> or <hash> or <key_file>";
|
||||
//piCout << "-p --pass <pass> " << Green << "- use secret from passphrase <pass>";
|
||||
//piCout << "-s --secret <hash> " << Green << "- use secret from hash <hash>";
|
||||
//piCout << "-k --key <key_file> " << Green << "- use secret from binary key_file <key_file>";
|
||||
//piCout << "-x --hex [<hex_key>] " << Green << "- use secret from hex hash <hex_key> or output in text hex";
|
||||
//piCout << "-r --random " << Green << "- generate random secret key";
|
||||
piCout << "-h --help " << Green << "- display this message and exit";
|
||||
piCout << "-i --ip " << Green << "- listen address, default \"0.0.0.0\"";
|
||||
piCout << "-p --port " << Green << "- listen port, default 10101";
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char * argv[]) {
|
||||
PICrypt::hash("");
|
||||
PICLI cli(argc, argv);
|
||||
cli.addArgument("genhash", true);
|
||||
cli.addArgument("help");
|
||||
cli.addArgument("ip", true);
|
||||
cli.addArgument("port", true);
|
||||
|
||||
if (!(cli.hasArgument("genhash") ||
|
||||
cli.hasArgument("crypt") ||
|
||||
cli.hasArgument("decrypt") ||
|
||||
cli.hasArgument("random")) ||
|
||||
cli.hasArgument("help")) {
|
||||
if (cli.hasArgument("help")) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
if (cli.hasArgument("ip"))
|
||||
ip = cli.argumentValue("ip");
|
||||
if (cli.hasArgument("port"))
|
||||
port = cli.argumentValue("port").toInt();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user