fb78d4a Ticket 10 - Improve command line tool arguments

Authored and Committed by William Brown 3 years ago
    Ticket 10 - Improve command line tool arguments
    
    Bug Description:  Previously our tools were a poc, and didn't
    have very good layout of commands.
    
    Fix Description:  Improve these, to be of the form:
    
    <command> <instance> <action> [<sub action="">] <options>
    
    For example:
    
    usage: dsadm [-h] [-v] instance {restart,start,stop,status,db2index} ...
    
    positional arguments:
      instance              The name of the instance to act upon
      {restart,start,stop,status,db2index}
                            action
        restart             Restart an instance of Directory Server, if it is
                            running: else start it.
        start               Start an instance of Directory Server, if it is not
                            currently running
        stop                Stop an instance of Directory Server, if it is
                            currently running
        status              Check running status of an instance of Directory
                            Server
        db2index            Initialise a reindex of the server database. The
                            server must be stopped for this to proceed.
    
    usage: dsidm instance user [-h] {list,get,get_dn,create,delete} ...
    
    positional arguments:
      {list,get,get_dn,create,delete}
                            action
        list                list
        get                 get
        get_dn              get_dn
        create              create
        delete              deletes the object
    
    usage: dsidm instance user create [-h] [--uid [UID]] [--cn [CN]] [--sn [SN]]
                                      [--uidNumber [UIDNUMBER]]
                                      [--gidNumber [GIDNUMBER]]
                                      [--homeDirectory [HOMEDIRECTORY]]
    
    optional arguments:
      -h, --help            show this help message and exit
      --uid [UID]           Value of uid
      --cn [CN]             Value of cn
      --sn [SN]             Value of sn
      --uidNumber [UIDNUMBER]
                            Value of uidNumber
      --gidNumber [GIDNUMBER]
                            Value of gidNumber
      --homeDirectory [HOMEDIRECTORY]
                            Value of homeDirectory
    
    https://pagure.io/lib389/issue/10
    
    Author: wibrown
    
    Review by: spichugi (Thanks!)
    
        
file modified
+14 -17
file modified
+16 -16
file added
+84
file modified
+18 -14
file modified
+6 -5
file modified
+11 -30
file modified
+6 -2
file modified
+3 -4
file modified
+2 -3
file modified
+3 -4
file modified
+2 -1