Skip to content

Commit

Permalink
ndnsec: add a short description to the --help output of each command
Browse files Browse the repository at this point in the history
Change-Id: Ifcc217bb096f1f27bceb609f5f117cf8b1d0c73d
  • Loading branch information
Pesa committed Jun 23, 2024
1 parent 9b911e9 commit 25d9c9f
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/manpages/ndnsec-key-gen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Synopsis
--------

**ndnsec key-gen** [**-h**] [**-n**] [**-t** *type*]
[**-k** *keyidtype*\|\ **--keyid** *keyid*] *identity*
[**-k** *keyidtype*\|\ **\--keyid** *keyid*] *identity*

Description
-----------
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/cert-dump.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions tools/ndnsec/cert-gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/cert-install.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/delete.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/export.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/get-default.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/import.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion tools/ndnsec/key-gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/list.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions tools/ndnsec/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tools/ndnsec/set-default.cpp
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions tools/ndnsec/sign-req.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 25d9c9f

Please sign in to comment.