You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/02/23 17:43:49 UTC

[trafficserver] branch 9.1.x updated: traffic_ctl - Fix lookup key for run-root option (#7484)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.1.x by this push:
     new 2004d24  traffic_ctl - Fix lookup key for run-root option (#7484)
2004d24 is described below

commit 2004d2443cb6d2000bc54d7848010427bd1cbd50
Author: Damian Meden <da...@gmail.com>
AuthorDate: Fri Feb 5 16:46:08 2021 +0000

    traffic_ctl - Fix lookup key for run-root option (#7484)
    
    - Fix lookup key for run-root option. Update ArgParser docs to make this
      clear. Also fix another doc warning.
    
    Co-authored-by: Damian Meden <da...@verizonmedia.com>
    (cherry picked from commit b13fc672310505f94be5f21141b4d06b52cbf930)
---
 doc/admin-guide/plugins/compress.en.rst                 | 2 +-
 doc/developer-guide/internal-libraries/ArgParser.en.rst | 4 +++-
 src/traffic_ctl/traffic_ctl.cc                          | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/plugins/compress.en.rst b/doc/admin-guide/plugins/compress.en.rst
index f58454e..b548ccb 100644
--- a/doc/admin-guide/plugins/compress.en.rst
+++ b/doc/admin-guide/plugins/compress.en.rst
@@ -104,7 +104,7 @@ versions of the content as :term:`alternates <alternate>`. When set to
 by the origin. Enabled by default.
 
 range-request
------
+-------------
 
 When set to ``true``, causes |TS| to compress responses to Range Requests.
 Disabled by default. Setting this to true while setting cache to false leads to delivering corrupted content.
diff --git a/doc/developer-guide/internal-libraries/ArgParser.en.rst b/doc/developer-guide/internal-libraries/ArgParser.en.rst
index 1448a90..235775b 100644
--- a/doc/developer-guide/internal-libraries/ArgParser.en.rst
+++ b/doc/developer-guide/internal-libraries/ArgParser.en.rst
@@ -158,7 +158,9 @@ Classes
 
    .. function:: Option &add_option(std::string const &long_option, std::string const &short_option, std::string const &description, std::string const &envvar = "", unsigned arg_num = 0, std::string const &default_value = "", std::string const &key = "")
 
-      Add an option to current command with *long name*, *short name*, *help description*, *environment variable*, *arguments expected*, *default value* and *lookup key*. Return The Option object itself.
+      Add an option to current command with *long name*, *short name*, *help description*, *environment variable*, *arguments expected*, *default value* and *lookup key*.
+      If no *lookup key* is provided, the *long name* will be used as lookup key without the prefix, for instance, for a long option ``--debug`` you should use ``debug`` as
+      as lookup key. Return The Option object itself.
 
    .. function:: Command &add_command(std::string const &cmd_name, std::string const &cmd_description, std::function<void()> const &f = nullptr, std::string const &key = "")
 
diff --git a/src/traffic_ctl/traffic_ctl.cc b/src/traffic_ctl/traffic_ctl.cc
index f71cd7b..f7d570e 100644
--- a/src/traffic_ctl/traffic_ctl.cc
+++ b/src/traffic_ctl/traffic_ctl.cc
@@ -275,7 +275,7 @@ main(int argc, const char **argv)
     diags->show_location                      = SHOW_LOCATION_DEBUG;
   }
 
-  argparser_runroot_handler(engine.arguments.get("--run-root").value(), argv[0]);
+  argparser_runroot_handler(engine.arguments.get("run-root").value(), argv[0]);
   Layout::create();
 
   // This is a little bit of a hack, for now it'll suffice.