diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-30 19:49:54 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-30 19:49:54 +0000 |
| commit | 965cecefa6156cee570acf81babda3d128f5f1b1 (patch) | |
| tree | b5092f0467c8488fc7b32d55c336bca512eb0426 | |
| parent | e7c8fbeb7d0c031eb751ac032303912134db2913 (diff) | |
| download | pica-pica-965cecefa6156cee570acf81babda3d128f5f1b1.tar.gz pica-pica-965cecefa6156cee570acf81babda3d128f5f1b1.zip | |
version info, help command line switches
git-svn-id: svn://localhost/project_picapica/trunk@134 fb96df88-216d-11de-830c-f3023f12d8ac
| -rwxr-xr-x | PICA_node.c | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/PICA_node.c b/PICA_node.c index 886d153..ae23bac 100755 --- a/PICA_node.c +++ b/PICA_node.c @@ -1039,12 +1039,6 @@ struct sockaddr_in sd; SSL_load_error_strings(); SSL_library_init(); -puts("This product includes software developed by the OpenSSL Project\n\ -for use in the OpenSSL Toolkit (http://www.openssl.org/\n"); -puts("This product includes cryptographic software written by\n\ -Eric Young (eay@cryptsoft.com)\n"); -puts(SSLeay_version(SSLEAY_VERSION)); - #ifdef WIN32 WSADATA wsd; @@ -2261,23 +2255,62 @@ while(1);////<<<<<<<<<< return 0; } +void print_usage() +{ +puts("Usage: pica-node [-f config-file]\n\ +\n\ +Options:\n\ + -f configuration file\n\ + -h show this text\n\ + -v verbose\n\ + -V print version info\n"); +} + +void print_version() +{ +puts("Pica Pica Node v0.1 \n(c) 2012 Anton Sviridenko\n"); + +////----include this only if OpenSSL is statically linked +puts("This product includes software developed by the OpenSSL Project\n\ +for use in the OpenSSL Toolkit (http://www.openssl.org/)\n"); +puts("This product includes cryptographic software written by\n\ +Eric Young (eay@cryptsoft.com)\n"); +puts(SSLeay_version(SSLEAY_VERSION)); +////--- + + +puts("\nThis product includes iniParser\n\ +Copyright (c) 2000-2012 by Nicolas Devillard.\n\ +MIT License"); + +} + void process_cmdline(int argc,char** argv) { int opt; -while((opt = getopt(argc, argv, "f:hv")) != -1) +while((opt = getopt(argc, argv, "f:hvV")) != -1) { switch(opt) { case 'f': nodecfg.config_file = strdup(optarg); break; + case 'h': + print_usage(); + exit(0); + break; + case 'v': + break; + case 'V': + print_version(); + exit(0); + break; } } } int main(int argc,char** argv) { -printf("PicaPica node started\n");//debug process_cmdline(argc, argv); |
