]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
authtool: update --help and manpage to match code.
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Tue, 5 Apr 2016 22:10:13 +0000 (22:10 +0000)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Tue, 5 Apr 2016 22:10:13 +0000 (22:10 +0000)
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
doc/man/8/ceph-authtool.rst
src/tools/ceph_authtool.cc

index 8565eba7617d62a745172c61ad9bcd1b996daeca..0187d89858fa295e2e3a1d9ef5b5757c4d7a0068 100644 (file)
@@ -9,9 +9,18 @@
 Synopsis
 ========
 
-| **ceph-authtool** *keyringfile* [ -l | --list ] [ -C | --create-keyring
-  ] [ -p | --print ] [ -n | --name *entityname* ] [ --gen-key ] [ -a |
-  --add-key *base64_key* ] [ --caps *capfile* ]
+| **ceph-authtool** *keyringfile*
+  [ -l | --list ]
+  [ -p | --print ]
+  [ -C | --create-keyring ]
+  [ -g | --gen-key ]
+  [ --gen-print-key ]
+  [ --import-keyring *otherkeyringfile* ]
+  [ -n | --name *entityname* ]
+  [ -u | --set-uid *auid* ]
+  [ -a | --add-key *base64_key* ]
+  [ --cap *subsystem* *capability* ]
+  [ --caps *capfile* ]
 
 
 Description
@@ -45,19 +54,36 @@ Options
 
    will create a new keyring, overwriting any existing keyringfile
 
-.. option:: --gen-key
+.. option:: -g, --gen-key
 
    will generate a new secret key for the specified entityname
 
-.. option:: --add-key
+.. option:: --gen-print-key
+
+   will generate a new secret key for the specified entityname,
+   without altering the keyringfile, printing the secret to stdout
+
+.. option:: --import-keyring *secondkeyringfile*
+
+   will import the content of a given keyring to the keyringfile
+
+.. option:: -n, --name *name*
+
+   specify entityname to operate on
+
+.. option:: -u, --set-uid *auid*
+
+   sets the auid (authenticated user id) for the specified entityname
+
+.. option:: -a, --add-key *base64_key*
 
    will add an encoded key to the keyring
 
-.. option:: --cap subsystem capability
+.. option:: --cap *subsystem* *capability*
 
    will set the capability for given subsystem
 
-.. option:: --caps capsfile
+.. option:: --caps *capsfile*
 
    will set all of capabilities associated with a given key, for all subsystems
 
index 469c9f3a638bf917bffc2eebf61fa43fdfe42360..ac6a920acf5c067efe729269d9fd93257ee818d5 100644 (file)
@@ -37,13 +37,14 @@ void usage()
        << "                                specified entityname\n"
        << "  --gen-print-key               will generate a new secret key without set it\n"
        << "                                to the keyringfile, prints the secret to stdout\n"
-       << "  --import-keyring              will import the content of a given keyring\n"
+       << "  --import-keyring FILE         will import the content of a given keyring\n"
        << "                                into the keyringfile\n"
-       << "  -u, --set-uid                 sets the auid (authenticated user id) for the\n"
+       << "  -n NAME, --name NAME         specify entityname to operate on\n"
+       << "  -u AUID, --set-uid AUID       sets the auid (authenticated user id) for the\n"
        << "                                specified entityname\n"
-       << "  -a, --add-key                 will add an encoded key to the keyring\n"
-       << "  --cap subsystem capability    will set the capability for given subsystem\n"
-       << "  --caps capsfile               will set all of capabilities associated with a\n"
+       << "  -a BASE64, --add-key BASE64   will add an encoded key to the keyring\n"
+       << "  --cap SUBSYSTEM CAPABILITY    will set the capability for given subsystem\n"
+       << "  --caps CAPSFILE               will set all of capabilities associated with a\n"
        << "                                given key, for all subsystems"
        << std::endl;
   exit(1);
@@ -73,6 +74,9 @@ int main(int argc, const char **argv)
   bool set_auid = false;
   std::vector<const char*>::iterator i;
 
+  /* Handle options unique to ceph-authtool
+   * -n NAME, --name NAME is handled by global_init
+   * */
   for (i = args.begin(); i != args.end(); ) {
     std::string val;
     if (ceph_argparse_double_dash(args, i)) {
@@ -117,6 +121,7 @@ int main(int argc, const char **argv)
       usage();
     }
   }
+
   if (fn.empty() && !gen_print_key) {
     cerr << argv[0] << ": must specify filename" << std::endl;
     usage();