From 814ad34909322f4c929b5b9d5db9ba0b3342b6a2 Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Tue, 26 Jan 2021 14:36:11 -0500 Subject: [PATCH] poke+pingserver: remove deprecated command-line options Change-Id: Ic5518f1ca54edcb4a4c4fbe16f96b207dc867ebf --- manpages/ndnpoke.rst | 12 ++++++------ tools/peek/ndnpoke/main.cpp | 38 +------------------------------------ tools/ping/server/main.cpp | 15 +-------------- 3 files changed, 8 insertions(+), 57 deletions(-) diff --git a/manpages/ndnpoke.rst b/manpages/ndnpoke.rst index 83abfeb..b5c105d 100644 --- a/manpages/ndnpoke.rst +++ b/manpages/ndnpoke.rst @@ -4,7 +4,7 @@ ndnpoke Synopsis -------- -**ndnpoke** [-h] [-u] [-F] [-x *freshness*] [-S *info*] [-w *timeout*] [-v] [-V] *name* +**ndnpoke** [-h] [-x *freshness*] [-F] [-S *info*] [-u\|\ -w *timeout*] [-v] [-V] *name* Description ----------- @@ -20,15 +20,12 @@ Options ``-h, --help`` Print help and exit. -``-u, --unsolicited`` - Send the Data packet without waiting for an incoming Interest. +``-x, --freshness `` + Set ``freshness`` (in milliseconds) as the ``FreshnessPeriod``. ``-F, --final`` Set the ``FinalBlockId`` to the last component of *name*. -``-x, --freshness `` - Set ``freshness`` (in milliseconds) as the ``FreshnessPeriod``. - ``-S, --signing-info `` Specify the parameters used to sign the Data packet. If omitted, the default key of the default identity is used. The general syntax is ``:``. The most @@ -41,6 +38,9 @@ Options is only a hash function, not a real signature, but it can significantly speed up packet signing operations. +``-u, --unsolicited`` + Send the Data packet without waiting for an incoming Interest. + ``-w, --timeout `` Quit the program after ``timeout`` milliseconds, even if no Interest has been received. diff --git a/tools/peek/ndnpoke/main.cpp b/tools/peek/ndnpoke/main.cpp index 482cf80..669ba2a 100644 --- a/tools/peek/ndnpoke/main.cpp +++ b/tools/peek/ndnpoke/main.cpp @@ -53,7 +53,6 @@ main(int argc, char* argv[]) std::string progName(argv[0]); PokeOptions options; std::string signingStr; - bool wantDigestSha256 = false; po::options_description genericOptDesc("Generic options"); genericOptDesc.add_options() @@ -81,15 +80,8 @@ main(int argc, char* argv[]) hiddenOptDesc.add_options() ("name", po::value(), "Data name"); - po::options_description deprecatedOptDesc; - deprecatedOptDesc.add_options() - ("force,f", po::bool_switch()) - ("identity,i", po::value()) - ("digest,D", po::bool_switch(&wantDigestSha256)) - ; - po::options_description optDesc; - optDesc.add(visibleOptDesc).add(hiddenOptDesc).add(deprecatedOptDesc); + optDesc.add(visibleOptDesc).add(hiddenOptDesc); po::positional_options_description optPos; optPos.add("name", -1); @@ -104,16 +96,6 @@ main(int argc, char* argv[]) return 2; } - if (vm["force"].as()) { - std::cerr << "WARNING: option '-f/--force' is deprecated and will be removed " - "in the near future. Use '-u/--unsolicited' instead." << std::endl; - options.wantUnsolicited = true; - } - if (wantDigestSha256 || vm.count("identity") > 0) { - std::cerr << "WARNING: options '-i/--identity' and '-D/--digest' are deprecated and will be " - "removed in the near future. Use '-S/--signing-info' instead." << std::endl; - } - if (vm.count("help") > 0) { usage(std::cout, progName, visibleOptDesc); return 0; @@ -149,24 +131,6 @@ main(int argc, char* argv[]) return 2; } - if (vm.count("identity") > 0) { - if (wantDigestSha256) { - std::cerr << "ERROR: conflicting '--digest' and '--identity' options specified" << std::endl; - return 2; - } - try { - options.signingInfo.setSigningIdentity(vm["identity"].as()); - } - catch (const Name::Error& e) { - std::cerr << "ERROR: invalid identity name: " << e.what() << std::endl; - return 2; - } - } - - if (wantDigestSha256) { - options.signingInfo.setSha256Signing(); - } - try { options.signingInfo = security::SigningInfo(signingStr); } diff --git a/tools/ping/server/main.cpp b/tools/ping/server/main.cpp index d43f1d2..e81125c 100644 --- a/tools/ping/server/main.cpp +++ b/tools/ping/server/main.cpp @@ -127,13 +127,8 @@ main(int argc, char* argv[]) hiddenDesc.add_options() ("prefix", po::value(&prefix)); - po::options_description deprecatedDesc; - deprecatedDesc.add_options() - ("_deprecated_freshness_,x", po::value()) - ; - po::options_description optDesc; - optDesc.add(visibleDesc).add(hiddenDesc).add(deprecatedDesc); + optDesc.add(visibleDesc).add(hiddenDesc); po::positional_options_description posDesc; posDesc.add("prefix", -1); @@ -154,11 +149,6 @@ main(int argc, char* argv[]) return 2; } - if (vm.count("_deprecated_freshness_") > 0) { - std::cerr << "WARNING: short option '-x' is deprecated and will be removed in the near " - "future. Please use '-f' or the long form '--freshness'." << std::endl; - } - if (vm.count("help") > 0) { usage(std::cout, argv[0], visibleDesc); return 0; @@ -177,9 +167,6 @@ main(int argc, char* argv[]) options.prefix = prefix; options.freshnessPeriod = time::milliseconds(vm["freshness"].as()); - if (vm.count("_deprecated_freshness_") > 0) { - options.freshnessPeriod = time::milliseconds(vm["_deprecated_freshness_"].as()); - } if (options.freshnessPeriod < 0_ms) { std::cerr << "ERROR: FreshnessPeriod cannot be negative" << std::endl; return 2;