git-svn-id: svn://db.shs.com.ru/pip@919 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2020-03-06 19:13:17 +00:00
parent b44bbaa583
commit 2611b354ab
2 changed files with 18 additions and 20 deletions

View File

@@ -1,5 +1,7 @@
message(STATUS "Building picloud") message(STATUS "Building picloud")
add_executable(picloud "main.cpp") file(GLOB CPPS "*.cpp")
file(GLOB HDRS "*.h")
add_executable(picloud ${CPPS} ${HDRS})
target_link_libraries(picloud pip pip_cloud) target_link_libraries(picloud pip pip_cloud)
if (DEFINED LIB) if (DEFINED LIB)
install(TARGETS picloud DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS picloud DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

View File

@@ -3,39 +3,35 @@
using namespace PICoutManipulators; using namespace PICoutManipulators;
PIString ip = "0.0.0.0";
int port = 10101;
void usage() { void usage() {
piCout << Bold << "PIP Cloud dispatcher"; piCout << Bold << "PIP Cloud Dispatcher";
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine; 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 << Green << Bold << "Details:";
piCout << "-h --help " << Green << "- display this message and exit"; piCout << "-h --help " << Green << "- display this message and exit";
//piCout << "-g --genhash " << Green << "- generate hash from <pass> string"; piCout << "-i --ip " << Green << "- listen address, default \"0.0.0.0\"";
//piCout << "-t --text " << Green << "- output in text base64"; piCout << "-p --port " << Green << "- listen port, default 10101";
//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";
} }
int main (int argc, char * argv[]) { int main (int argc, char * argv[]) {
PICrypt::hash(""); PICrypt::hash("");
PICLI cli(argc, argv); PICLI cli(argc, argv);
cli.addArgument("genhash", true); cli.addArgument("help");
cli.addArgument("ip", true);
cli.addArgument("port", true);
if (!(cli.hasArgument("genhash") || if (cli.hasArgument("help")) {
cli.hasArgument("crypt") ||
cli.hasArgument("decrypt") ||
cli.hasArgument("random")) ||
cli.hasArgument("help")) {
usage(); usage();
return 0; return 0;
} }
if (cli.hasArgument("ip"))
ip = cli.argumentValue("ip");
if (cli.hasArgument("port"))
port = cli.argumentValue("port").toInt();
return 0; return 0;
} }