Mercurial > hg > piper-cpp
changeset 279:b7eec400cd94
Support long options as well
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 01 Nov 2018 14:04:58 +0000 |
parents | 71b166bcbcc3 |
children | 4b581a498981 |
files | vamp-server/simple-server.cpp |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/vamp-server/simple-server.cpp Wed Oct 17 15:43:35 2018 +0100 +++ b/vamp-server/simple-server.cpp Thu Nov 01 14:04:58 2018 +0000 @@ -91,9 +91,9 @@ " " << myname << " -h\n\n" " where\n" " <format>: the format to read and write messages in (\"json\" or \"capnp\")\n" - " -d: also print debug information to stderr\n" - " -v: print version number to stdout and exit\n" - " -h: print this text to stderr and exit\n\n" + " -d, --debug: also print debug information to stderr\n" + " -v, --version: print version number to stdout and exit\n" + " -h, --help: print this text to stderr and exit\n\n" "Expects Piper request messages in either Cap'n Proto or JSON format on stdin,\n" "and writes response messages in the same format to stdout.\n\n" "This server is intended for simple process separation. It's only suitable for\n" @@ -639,19 +639,19 @@ bool debug = false; string arg = argv[1]; - if (arg == "-h") { + if (arg == "-h" || arg == "--help") { if (argc == 2) { usage(true); } else { usage(); } - } else if (arg == "-v") { + } else if (arg == "-v" || arg == "--version") { if (argc == 2) { version(); } else { usage(); } - } else if (arg == "-d") { + } else if (arg == "-d" || arg == "--debug") { if (argc == 2) { usage(); } else {