diff options
author | hitsedesen <hitsedesen@yandex-team.com> | 2023-09-07 09:14:47 +0300 |
---|---|---|
committer | hitsedesen <hitsedesen@yandex-team.com> | 2023-09-07 10:21:52 +0300 |
commit | 3cd71626b58f2e1958655ea8969d6878ddba51df (patch) | |
tree | 86be15b1e67219f4e0439cbbaafce441d3e7747f /library/cpp/getopt/last_getopt_demo/demo.cpp | |
parent | 8662052579e525caf2a824dac5f7589de99ef10c (diff) | |
download | ydb-3cd71626b58f2e1958655ea8969d6878ddba51df.tar.gz |
Add choices to getopt options
Diffstat (limited to 'library/cpp/getopt/last_getopt_demo/demo.cpp')
-rw-r--r-- | library/cpp/getopt/last_getopt_demo/demo.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/library/cpp/getopt/last_getopt_demo/demo.cpp b/library/cpp/getopt/last_getopt_demo/demo.cpp index 79426a9cc9..a0e82a936c 100644 --- a/library/cpp/getopt/last_getopt_demo/demo.cpp +++ b/library/cpp/getopt/last_getopt_demo/demo.cpp @@ -81,17 +81,16 @@ protected: .Help("specify HTTP method") .CompletionArgHelp("http method") .StoreResult(&ExplicitMethod_) - .Completer( - NLastGetopt::NComp::Choice( - {{"GET", "request representation of the specified resource"}, - {"HEAD", "request response identical to that of GET, but without response body"}, - {"POST", "submit an entry to the specified resource"}, - {"PUT", "replace representation of the specified resource with the request body"}, - {"DELETE", "delete the specified resource"}, - {"CONNECT", "establish a tunnel to the server identified by the target resource"}, - {"OPTIONS", "describe the communication options for the target resource"}, - {"TRACE", "perform a message loop-back test"}, - {"PATCH", "apply partial modifications to the specified resource"}})); + .ChoicesWithCompletion({ + {"GET", "request representation of the specified resource"}, + {"HEAD", "request response identical to that of GET, but without response body"}, + {"POST", "submit an entry to the specified resource"}, + {"PUT", "replace representation of the specified resource with the request body"}, + {"DELETE", "delete the specified resource"}, + {"CONNECT", "establish a tunnel to the server identified by the target resource"}, + {"OPTIONS", "describe the communication options for the target resource"}, + {"TRACE", "perform a message loop-back test"}, + {"PATCH", "apply partial modifications to the specified resource"}}); opts.AddLongOption('U', "user-agent") .RequiredArgument("agent-string") |