From 71bbf93fa2594b352990713608154e0799a64fcc Mon Sep 17 00:00:00 2001 From: fduncanh Date: Fri, 22 Jul 2022 03:49:21 -0400 Subject: [PATCH] minor change: -v for version info only, -h for help text --- uxplay.1 | 4 +++- uxplay.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/uxplay.1 b/uxplay.1 index e34909c..8191971 100644 --- a/uxplay.1 +++ b/uxplay.1 @@ -107,4 +107,6 @@ UxPlay 1.55: An open\-source AirPlay mirroring server based on RPiPlay .TP \fB\-d\fR Enable debug logging .TP -\fB\-v\fR or \fB\-h\fR Displays this help and version information +\fB\-v\fR Displays version information +.TP +\fB\-h\fR Displays help information diff --git a/uxplay.cpp b/uxplay.cpp index 0e59273..5c4e404 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -369,7 +369,8 @@ static void print_info (char *name) { printf(" x increases when audio format changes. If n is given, <= n\n"); printf(" audio packets are dumped. \"aud\"= unknown format.\n"); printf("-d Enable debug logging\n"); - printf("-v or -h Displays this help and version information\n"); + printf("-v Displays version information\n"); + printf("-h Displays this help\n"); } bool option_has_value(const int i, const int argc, std::string option, const char *next_arg) { @@ -557,9 +558,12 @@ void parse_arguments (int argc, char *argv[]) { use_audio = false; } else if (arg == "-d") { debug_log = !debug_log; - } else if (arg == "-h" || arg == "-v") { + } else if (arg == "-h") { print_info(argv[0]); exit(0); + } else if (arg == "-v") { + printf("UxPlay version %s; for help, use option \"-h\"\n", VERSION); + exit(0); } else if (arg == "-vp") { if (!option_has_value(i, argc, arg, argv[i+1])) exit(1); video_parser.erase();