You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/02/26 16:33:15 UTC
[trafficserver] branch master updated: TS-3838: -h help arguments
are now ordered by name This closes #1499.
This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new c53ab66 TS-3838: -h help arguments are now ordered by name This closes #1499.
c53ab66 is described below
commit c53ab661b6a5f229a85a75abb294fd96a2b6bc4e
Author: Christopher Walker <cn...@uchicago.edu>
AuthorDate: Sat Feb 25 22:07:45 2017 -0600
TS-3838: -h help arguments are now ordered by name
This closes #1499.
---
proxy/Main.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 47d7943..e7ab10e 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -41,6 +41,7 @@
#include "api/ts/ts.h" // This is sadly needed because of us using TSThreadInit() for some reason.
#include <syslog.h>
+#include <algorithm>
#if !defined(linux)
#include <sys/lock.h>
@@ -182,7 +183,7 @@ static volatile int delay_listen_for_cache_p = 0;
AppVersionInfo appVersionInfo; // Build info for this application
-static const ArgumentDescription argument_descriptions[] = {
+static ArgumentDescription argument_descriptions[] = {
{"net_threads", 'n', "Number of Net Threads", "I", &num_of_net_threads, "PROXY_NET_THREADS", nullptr},
{"cluster_threads", 'Z', "Number of Cluster Threads", "I", &num_of_cluster_threads, "PROXY_CLUSTER_THREADS", nullptr},
{"udp_threads", 'U', "Number of UDP Threads", "I", &num_of_udp_threads, "PROXY_UDP_THREADS", nullptr},
@@ -1530,6 +1531,9 @@ main(int /* argc ATS_UNUSED */, const char **argv)
Layout::create();
chdir_root(); // change directory to the install root of traffic server.
+ std::sort(argument_descriptions, argument_descriptions + countof(argument_descriptions),
+ [](ArgumentDescription &a, ArgumentDescription &b) { return 0 > strcasecmp(a.name, b.name); });
+
process_args(&appVersionInfo, argument_descriptions, countof(argument_descriptions), argv);
command_flag = command_flag || *command_string;
command_index = find_cmd_index(command_string);
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].