From 25d9c9f32c7963f6c949ba075d587959ecde942c Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Sun, 23 Jun 2024 15:10:05 -0400 Subject: [PATCH] ndnsec: add a short description to the `--help` output of each command Change-Id: Ifcc217bb096f1f27bceb609f5f117cf8b1d0c73d --- docs/manpages/ndnsec-key-gen.rst | 2 +- tools/ndnsec/cert-dump.cpp | 4 +++- tools/ndnsec/cert-gen.cpp | 2 ++ tools/ndnsec/cert-install.cpp | 4 +++- tools/ndnsec/delete.cpp | 4 +++- tools/ndnsec/export.cpp | 4 +++- tools/ndnsec/get-default.cpp | 4 +++- tools/ndnsec/import.cpp | 4 +++- tools/ndnsec/key-gen.cpp | 5 ++++- tools/ndnsec/list.cpp | 4 +++- tools/ndnsec/main.cpp | 14 +++++++------- tools/ndnsec/set-default.cpp | 4 +++- tools/ndnsec/sign-req.cpp | 2 ++ 13 files changed, 40 insertions(+), 17 deletions(-) diff --git a/docs/manpages/ndnsec-key-gen.rst b/docs/manpages/ndnsec-key-gen.rst index 49ef7772e..6368da19d 100644 --- a/docs/manpages/ndnsec-key-gen.rst +++ b/docs/manpages/ndnsec-key-gen.rst @@ -5,7 +5,7 @@ Synopsis -------- **ndnsec key-gen** [**-h**] [**-n**] [**-t** *type*] -[**-k** *keyidtype*\|\ **--keyid** *keyid*] *identity* +[**-k** *keyidtype*\|\ **\--keyid** *keyid*] *identity* Description ----------- diff --git a/tools/ndnsec/cert-dump.cpp b/tools/ndnsec/cert-dump.cpp index 0baf8dffa..3b4f9cf4a 100644 --- a/tools/ndnsec/cert-dump.cpp +++ b/tools/ndnsec/cert-dump.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -43,6 +43,8 @@ ndnsec_cert_dump(int argc, char** argv) po::options_description description( "Usage: ndnsec cert-dump [-h] [-p] [-r [-H HOST] [-P PORT]] [-i|-k|-f] [-n] NAME\n" "\n" + "Display a certificate from a file or the local PIB.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/cert-gen.cpp b/tools/ndnsec/cert-gen.cpp index e7c49ad87..ae60efd78 100644 --- a/tools/ndnsec/cert-gen.cpp +++ b/tools/ndnsec/cert-gen.cpp @@ -46,6 +46,8 @@ ndnsec_cert_gen(int argc, char** argv) "Usage: ndnsec cert-gen [-h] [-S TIMESTAMP] [-E TIMESTAMP] [-I INFO]...\n" " [-s IDENTITY] [-i ISSUER] [-r] FILE\n" "\n" + "Issue a certificate from a certificate signing request.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/cert-install.cpp b/tools/ndnsec/cert-install.cpp index 345ee2463..f7ce2f09d 100644 --- a/tools/ndnsec/cert-install.cpp +++ b/tools/ndnsec/cert-install.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -42,6 +42,8 @@ ndnsec_cert_install(int argc, char** argv) po::options_description description( "Usage: ndnsec cert-install [-h] [-I|-K|-N] [-f] FILE\n" "\n" + "Import a certificate from a file.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/delete.cpp b/tools/ndnsec/delete.cpp index 25de41cb1..4b19892da 100644 --- a/tools/ndnsec/delete.cpp +++ b/tools/ndnsec/delete.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -36,6 +36,8 @@ ndnsec_delete(int argc, char** argv) po::options_description description( "Usage: ndnsec delete [-h] [-k|-c] [-n] NAME\n" "\n" + "Delete an identity, key, or certificate.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/export.cpp b/tools/ndnsec/export.cpp index 5641e0886..0350bac04 100644 --- a/tools/ndnsec/export.cpp +++ b/tools/ndnsec/export.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -47,6 +47,8 @@ ndnsec_export(int argc, char** argv) po::options_description visibleOptDesc( "Usage: ndnsec export [-h] [-o FILE] [-P PASSPHRASE] [-i|-k|-c] NAME\n" "\n" + "Export a private key and its certificate in SafeBag format.\n" + "\n" "Options"); visibleOptDesc.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/get-default.cpp b/tools/ndnsec/get-default.cpp index 8dba1bfad..3d3a7f231 100644 --- a/tools/ndnsec/get-default.cpp +++ b/tools/ndnsec/get-default.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -38,6 +38,8 @@ ndnsec_get_default(int argc, char** argv) po::options_description description( "Usage: ndnsec get-default [-h] [-k|-c] [-i ID|-K KEY] [-q]\n" "\n" + "Show the default identity, key, or certificate.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/import.cpp b/tools/ndnsec/import.cpp index 9e0c830f0..98a4c501b 100644 --- a/tools/ndnsec/import.cpp +++ b/tools/ndnsec/import.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -43,6 +43,8 @@ ndnsec_import(int argc, char** argv) po::options_description description( "Usage: ndnsec import [-h] [-P PASSPHRASE] [-i] FILE\n" "\n" + "Import a private key and its certificate from a SafeBag.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/key-gen.cpp b/tools/ndnsec/key-gen.cpp index bd3712eaa..77c7d57f0 100644 --- a/tools/ndnsec/key-gen.cpp +++ b/tools/ndnsec/key-gen.cpp @@ -36,7 +36,10 @@ ndnsec_key_gen(int argc, char** argv) std::string userKeyId; po::options_description description( - "Usage: ndnsec key-gen [-h] [-n] [-t TYPE] [-k KEYIDTYPE|--keyid KEYID] [-i] IDENTITY\n" + "Usage: ndnsec key-gen [-h] [-n] [-t TYPE] [-k KEYIDTYPE|--keyid KEYID]\n" + " [-i] IDENTITY\n" + "\n" + "Generate a public/private key pair for an identity.\n" "\n" "Options"); description.add_options() diff --git a/tools/ndnsec/list.cpp b/tools/ndnsec/list.cpp index 3b02b8073..201ffbb4f 100644 --- a/tools/ndnsec/list.cpp +++ b/tools/ndnsec/list.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -208,6 +208,8 @@ ndnsec_list(int argc, char** argv) po::options_description description( "Usage: ndnsec list [-h] [-k] [-c] [-v]\n" "\n" + "List all known identities, keys, and certificates.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/main.cpp b/tools/ndnsec/main.cpp index aa6ce370d..a9a055b80 100644 --- a/tools/ndnsec/main.cpp +++ b/tools/ndnsec/main.cpp @@ -35,14 +35,14 @@ constexpr std::string_view NDNSEC_HELP_TEXT = R"STR(Usage: ndnsec COMMAND [OPTIO Available commands: help Print this help text - list List all known identities/keys/certificates - get-default Show the default identity/key/certificate - set-default Change the default identity/key/certificate - delete Delete an identity/key/certificate - key-gen Generate a key for an identity + list List all known identities, keys, and certificates + get-default Show the default identity, key, or certificate + set-default Change the default identity, key, or certificate + delete Delete an identity, key, or certificate + key-gen Generate a key pair for an identity sign-req Generate a certificate signing request - cert-gen Create a certificate for an identity - cert-dump Export a certificate + cert-gen Issue a certificate for an identity + cert-dump Display a certificate cert-install Import a certificate from a file export Export an identity as a SafeBag import Import an identity from a SafeBag diff --git a/tools/ndnsec/set-default.cpp b/tools/ndnsec/set-default.cpp index b0ebf09ff..f78d23edb 100644 --- a/tools/ndnsec/set-default.cpp +++ b/tools/ndnsec/set-default.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2013-2023 Regents of the University of California. + * Copyright (c) 2013-2024 Regents of the University of California. * * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). * @@ -36,6 +36,8 @@ ndnsec_set_default(int argc, char** argv) po::options_description description( "Usage: ndnsec set-default [-h] [-k|-c] [-n] NAME\n" "\n" + "Change the default identity, key, or certificate.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message") diff --git a/tools/ndnsec/sign-req.cpp b/tools/ndnsec/sign-req.cpp index 2023ce974..f3f714fb3 100644 --- a/tools/ndnsec/sign-req.cpp +++ b/tools/ndnsec/sign-req.cpp @@ -37,6 +37,8 @@ ndnsec_sign_req(int argc, char** argv) po::options_description description( "Usage: ndnsec sign-req [-h] [-k] [-n] NAME\n" "\n" + "Generate a certificate signing request.\n" + "\n" "Options"); description.add_options() ("help,h", "produce help message")