poke+pingserver: remove deprecated command-line options
Change-Id: Ic5518f1ca54edcb4a4c4fbe16f96b207dc867ebf
This commit is contained in:
1 parent
a0e6b60e8f
commit
814ad34909
3 files changed
+8
-57
No files matched your search
@@ -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 <freshness>``
|
||||
Set ``freshness`` (in milliseconds) as the ``FreshnessPeriod``.
|
||||
|
||||
``-F, --final``
|
||||
Set the ``FinalBlockId`` to the last component of *name*.
|
||||
|
||||
``-x, --freshness <freshness>``
|
||||
Set ``freshness`` (in milliseconds) as the ``FreshnessPeriod``.
|
||||
|
||||
``-S, --signing-info <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 ``<scheme>:<name>``. 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 <timeout>``
|
||||
Quit the program after ``timeout`` milliseconds, even if no Interest has been received.
|
||||
|
||||
|
||||
@@ -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<std::string>(), "Data name");
|
||||
|
||||
po::options_description deprecatedOptDesc;
|
||||
deprecatedOptDesc.add_options()
|
||||
("force,f", po::bool_switch())
|
||||
("identity,i", po::value<std::string>())
|
||||
("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<bool>()) {
|
||||
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<std::string>());
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -127,13 +127,8 @@ main(int argc, char* argv[])
|
||||
hiddenDesc.add_options()
|
||||
("prefix", po::value<std::string>(&prefix));
|
||||
|
||||
po::options_description deprecatedDesc;
|
||||
deprecatedDesc.add_options()
|
||||
("_deprecated_freshness_,x", po::value<time::milliseconds::rep>())
|
||||
;
|
||||
|
||||
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<time::milliseconds::rep>());
|
||||
if (vm.count("_deprecated_freshness_") > 0) {
|
||||
options.freshnessPeriod = time::milliseconds(vm["_deprecated_freshness_"].as<time::milliseconds::rep>());
|
||||
}
|
||||
if (options.freshnessPeriod < 0_ms) {
|
||||
std::cerr << "ERROR: FreshnessPeriod cannot be negative" << std::endl;
|
||||
return 2;
|
||||
|
||||
Reference in new issue
Block a user