From 9213f398adf9aa29d0c59a4caee440dba70e4a7d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Oct 2011 23:27:22 +0200 Subject: samba-tool: Don't require full prog line to be in synopsis. --- source4/scripting/python/samba/netcmd/__init__.py | 28 +++++++-------- source4/scripting/python/samba/netcmd/dbcheck.py | 2 +- .../scripting/python/samba/netcmd/delegation.py | 18 ++++------ source4/scripting/python/samba/netcmd/domain.py | 12 +++---- source4/scripting/python/samba/netcmd/drs.py | 10 +++--- source4/scripting/python/samba/netcmd/dsacl.py | 2 +- source4/scripting/python/samba/netcmd/fsmo.py | 17 ++++----- source4/scripting/python/samba/netcmd/gpo.py | 40 +++++++++++----------- source4/scripting/python/samba/netcmd/group.py | 8 ++--- source4/scripting/python/samba/netcmd/ldapcmp.py | 2 +- source4/scripting/python/samba/netcmd/ntacl.py | 4 +-- source4/scripting/python/samba/netcmd/rodc.py | 4 +-- source4/scripting/python/samba/netcmd/spn.py | 10 ++---- source4/scripting/python/samba/netcmd/testparm.py | 2 +- source4/scripting/python/samba/netcmd/time.py | 2 +- source4/scripting/python/samba/netcmd/user.py | 14 ++++---- source4/scripting/python/samba/netcmd/vampire.py | 3 +- 17 files changed, 80 insertions(+), 98 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index ad6e688da8..4d40b69d88 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -66,8 +66,8 @@ class Command(object): outf = sys.stdout errf = sys.stderr - def usage(self, *args): - parser, _ = self._create_parser() + def usage(self, prog, *args): + parser, _ = self._create_parser(prog) parser.print_usage() def show_command_error(self, e): @@ -103,9 +103,11 @@ class Command(object): if force_traceback or samba.get_debug_level() >= 3: traceback.print_tb(etraceback) - def _create_parser(self): - parser = optparse.OptionParser(usage=self.synopsis, - description=self.full_description) + def _create_parser(self, prog): + parser = optparse.OptionParser( + usage=self.synopsis, + description=self.full_description, + prog=prog) parser.add_options(self.takes_options) optiongroups = {} for name, optiongroup in self.takes_optiongroups.iteritems(): @@ -117,7 +119,7 @@ class Command(object): self.outf.write(text+"\n") def _run(self, *argv): - parser, optiongroups = self._create_parser() + parser, optiongroups = self._create_parser(argv[0]) opts, args = parser.parse_args(list(argv)) # Filter out options from option groups args = args[1:] @@ -170,13 +172,10 @@ class SuperCommand(Command): def _run(self, myname, subcommand=None, *args): if subcommand in self.subcommands: - return self.subcommands[subcommand]._run(subcommand, *args) + return self.subcommands[subcommand]._run( + "%s %s" % (myname, subcommand), *args) - if myname == "samba-tool": - usage = "samba-tool " - else: - usage = "samba-tool %s " % myname - self.outf.write("Usage: %s [options]\n" % usage) + self.usage(myname) self.outf.write("Available subcommands:\n") subcmds = self.subcommands.keys() subcmds.sort() @@ -187,14 +186,15 @@ class SuperCommand(Command): if subcommand in [None]: raise CommandError("You must specify a subcommand") if subcommand in ['help', '-h', '--help']: - self.outf.write("For more help on a specific subcommand, please type: %s (-h|--help)\n" % usage) + self.outf.write("For more help on a specific subcommand, please type: %s (-h|--help)\n" % myname) return 0 raise CommandError("No such subcommand '%s'" % subcommand) class CommandError(Exception): - '''an exception class for samba-tool cmd errors''' + """An exception class for samba-tool Command errors.""" + def __init__(self, message, inner_exception=None): self.message = message self.inner_exception = inner_exception diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py index 44f3dedf34..1d4a5b4f33 100644 --- a/source4/scripting/python/samba/netcmd/dbcheck.py +++ b/source4/scripting/python/samba/netcmd/dbcheck.py @@ -33,7 +33,7 @@ from samba.dbchecker import dbcheck class cmd_dbcheck(Command): """check local AD database for errors""" - synopsis = "%prog dbcheck [] [options]" + synopsis = "%prog [] [options]" takes_args = ["DN?"] diff --git a/source4/scripting/python/samba/netcmd/delegation.py b/source4/scripting/python/samba/netcmd/delegation.py index 24f4f51937..0aed394657 100644 --- a/source4/scripting/python/samba/netcmd/delegation.py +++ b/source4/scripting/python/samba/netcmd/delegation.py @@ -36,11 +36,10 @@ from samba.netcmd import ( ) - class cmd_delegation_show(Command): """Show the delegation setting of an account.""" - - synopsis = "%prog delegation show [options]" + + synopsis = "%prog show [options]" takes_args = ["accountname"] @@ -74,11 +73,10 @@ class cmd_delegation_show(Command): self.outf.write("msDS-AllowedToDelegateTo: %s\n" % a) - class cmd_delegation_for_any_service(Command): """Set/unset UF_TRUSTED_FOR_DELEGATION for an account.""" - synopsis = "%prog delegation for-any-service [(on|off)] [options]" + synopsis = "%prog [(on|off)] [options]" takes_args = ["accountname", "onoff"] @@ -109,11 +107,10 @@ class cmd_delegation_for_any_service(Command): raise CommandError(err) - class cmd_delegation_for_any_protocol(Command): """Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.""" - synopsis = "%prog delegation for-any-protocol [(on|off)] [options]" + synopsis = "%prog [(on|off)] [options]" takes_args = ["accountname", "onoff"] @@ -144,11 +141,10 @@ class cmd_delegation_for_any_protocol(Command): raise CommandError(err) - class cmd_delegation_add_service(Command): """Add a service principal as msDS-AllowedToDelegateTo""" - synopsis = "%prog delegation add-service [options]" + synopsis = "%prog [options]" takes_args = ["accountname", "principal"] @@ -180,11 +176,10 @@ class cmd_delegation_add_service(Command): raise CommandError(err) - class cmd_delegation_del_service(Command): """Delete a service principal as msDS-AllowedToDelegateTo""" - synopsis = "%prog delegation del-service [options]" + synopsis = "%prog [options]" takes_args = ["accountname", "principal"] @@ -216,7 +211,6 @@ class cmd_delegation_del_service(Command): raise CommandError(err) - class cmd_delegation(SuperCommand): """Delegation management""" diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 77026b9839..ce9d7d8682 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -62,7 +62,7 @@ def get_testparm_var(testparm, smbconf, varname): class cmd_domain_export_keytab(Command): """Dumps kerberos keys of the domain into a keytab""" - synopsis = "%prog domain exportkeytab [options]" + synopsis = "%prog [options]" takes_options = [ ] @@ -79,7 +79,7 @@ class cmd_domain_export_keytab(Command): class cmd_domain_join(Command): """Joins domain as either member or backup domain controller *""" - synopsis = "%prog domain join [DC|RODC|MEMBER|SUBDOMAIN] [options]" + synopsis = "%prog [DC|RODC|MEMBER|SUBDOMAIN] [options]" takes_options = [ Option("--server", help="DC to join", type=str), @@ -140,7 +140,7 @@ class cmd_domain_join(Command): class cmd_domain_level(Command): """Raises domain and forest function levels""" - synopsis = "%prog domain level (show|raise ) [options]" + synopsis = "%prog (show|raise ) [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -339,7 +339,7 @@ class cmd_domain_level(Command): class cmd_domain_machinepassword(Command): """Gets a machine password out of our SAM""" - synopsis = "%prog domain machinepassword [options]" + synopsis = "%prog [options]" takes_args = ["secret"] @@ -370,7 +370,7 @@ class cmd_domain_passwordsettings(Command): and maximum password age) on a Samba4 server. """ - synopsis = "%prog domain passwordsettings (show|set ) [options]" + synopsis = "%prog (show|set ) [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -534,7 +534,7 @@ class cmd_domain_samba3upgrade(Command): samba3 testparm utility (with --testparm). """ - synopsis = "%prog domain samba3upgrade [options] " + synopsis = "%prog [options] " takes_optiongroups = { "sambaopts": options.SambaOptions, diff --git a/source4/scripting/python/samba/netcmd/drs.py b/source4/scripting/python/samba/netcmd/drs.py index 78b998e0f5..2f0e3066ae 100644 --- a/source4/scripting/python/samba/netcmd/drs.py +++ b/source4/scripting/python/samba/netcmd/drs.py @@ -101,7 +101,7 @@ def get_dsServiceName(samdb): class cmd_drs_showrepl(Command): """show replication status""" - synopsis = "%prog drs showrepl [] [options]" + synopsis = "%prog [] [options]" takes_args = ["DC?"] @@ -206,7 +206,7 @@ class cmd_drs_showrepl(Command): class cmd_drs_kcc(Command): """trigger knowledge consistency center run""" - synopsis = "%prog drs kcc [] [options]" + synopsis = "%prog [] [options]" takes_args = ["DC?"] @@ -269,7 +269,7 @@ def drs_local_replicate(self, SOURCE_DC, NC): class cmd_drs_replicate(Command): """replicate a naming context between two DCs""" - synopsis = "%prog drs replicate [options]" + synopsis = "%prog [options]" takes_args = ["DEST_DC", "SOURCE_DC", "NC"] @@ -344,7 +344,7 @@ class cmd_drs_replicate(Command): class cmd_drs_bind(Command): """show DRS capabilities of a server""" - synopsis = "%prog drs bind [] [options]" + synopsis = "%prog [] [options]" takes_args = ["DC?"] @@ -437,7 +437,7 @@ class cmd_drs_bind(Command): class cmd_drs_options(Command): """query or change 'options' for NTDS Settings object of a domain controller""" - synopsis = ("%prog drs options [] [options]") + synopsis = "%prog [] [options]" takes_args = ["DC?"] diff --git a/source4/scripting/python/samba/netcmd/dsacl.py b/source4/scripting/python/samba/netcmd/dsacl.py index 97d4eb8534..b68af9ba39 100644 --- a/source4/scripting/python/samba/netcmd/dsacl.py +++ b/source4/scripting/python/samba/netcmd/dsacl.py @@ -50,7 +50,7 @@ from samba.netcmd import ( class cmd_dsacl_set(Command): """Modify access list on a directory object""" - synopsis = "%prog dsacl set [options]" + synopsis = "%prog [options]" car_help = """ The access control right to allow or deny """ takes_options = [ diff --git a/source4/scripting/python/samba/netcmd/fsmo.py b/source4/scripting/python/samba/netcmd/fsmo.py index e8e24b2de1..4449a306a9 100644 --- a/source4/scripting/python/samba/netcmd/fsmo.py +++ b/source4/scripting/python/samba/netcmd/fsmo.py @@ -34,11 +34,10 @@ from samba.netcmd import ( from samba.samdb import SamDB - class cmd_fsmo_seize(Command): """Seize the role""" - - synopsis = "%prog fsmo seize [options]" + + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -99,7 +98,7 @@ all=all of the above"""), def run(self, force=None, H=None, role=None, credopts=None, sambaopts=None, versionopts=None): - + lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp, fallback_machine=True) @@ -116,11 +115,10 @@ all=all of the above"""), self.seize_role(role, samdb, force) - class cmd_fsmo_show(Command): """Show the roles""" - synopsis = "%prog fsmo show [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -129,8 +127,7 @@ class cmd_fsmo_show(Command): takes_args = [] - def run(self, H=None, - credopts=None, sambaopts=None, versionopts=None): + def run(self, H=None, credopts=None, sambaopts=None, versionopts=None): lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp, fallback_machine=True) @@ -173,13 +170,12 @@ class cmd_fsmo_show(Command): self.message("PdcEmulationMasterRole owner: " + self.pdcEmulator) self.message("DomainNamingMasterRole owner: " + self.namingMaster) self.message("SchemaMasterRole owner: " + self.schemaMaster) - class cmd_fsmo_transfer(Command): """Transfer the role""" - synopsis = "%prog fsmo transfer [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -252,7 +248,6 @@ all=all of the above"""), self.transfer_role(role, samdb) - class cmd_fsmo(SuperCommand): """Flexible Single Master Operations (FSMO) roles management""" diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py index 0d96dbc56f..f87d192ff7 100644 --- a/source4/scripting/python/samba/netcmd/gpo.py +++ b/source4/scripting/python/samba/netcmd/gpo.py @@ -237,7 +237,7 @@ def create_directory_hier(conn, remotedir): class cmd_listall(Command): """list all GPOs""" - synopsis = "%prog gpo listall [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -268,13 +268,13 @@ class cmd_listall(Command): class cmd_list(Command): """list GPOs for an account""" - synopsis = "%prog gpo list [options]" + synopsis = "%prog [options]" - takes_args = [ 'username' ] + takes_args = ['username'] takes_options = [ - Option("-H", "--URL", help="LDB URL for database or target server", type=str, - metavar="URL", dest="H") + Option("-H", "--URL", help="LDB URL for database or target server", + type=str, metavar="URL", dest="H") ] def run(self, username, H=None, sambaopts=None, credopts=None, versionopts=None): @@ -377,7 +377,7 @@ class cmd_list(Command): class cmd_show(Command): """Show information for a GPO""" - synopsis = "%prog gpo show [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -385,7 +385,7 @@ class cmd_show(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'gpo' ] + takes_args = ['gpo'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str) @@ -421,7 +421,7 @@ class cmd_show(Command): class cmd_getlink(Command): """List GPO Links for a container""" - synopsis = "%prog gpo getlink [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -429,7 +429,7 @@ class cmd_getlink(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'container_dn' ] + takes_args = ['container_dn'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str) @@ -468,7 +468,7 @@ class cmd_getlink(Command): class cmd_setlink(Command): """Add or Update a GPO link to a container""" - synopsis = "%prog gpo setlink [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -476,7 +476,7 @@ class cmd_setlink(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'container_dn', 'gpo' ] + takes_args = ['container_dn', 'gpo'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), @@ -556,7 +556,7 @@ class cmd_setlink(Command): class cmd_dellink(Command): """Delete GPO link from a container""" - synopsis = "%prog gpo dellink [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -564,7 +564,7 @@ class cmd_dellink(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'container_dn', 'gpo' ] + takes_args = ['container_dn', 'gpo'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), @@ -625,7 +625,7 @@ class cmd_dellink(Command): class cmd_getinheritance(Command): """Get inheritance flag for a container""" - synopsis = "%prog gpo getinheritance [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -633,7 +633,7 @@ class cmd_getinheritance(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'container_dn' ] + takes_args = ['container_dn'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str) @@ -669,7 +669,7 @@ class cmd_getinheritance(Command): class cmd_setinheritance(Command): """Set inheritance flag on a container""" - synopsis = "%prog gpo setinheritance [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -724,7 +724,7 @@ class cmd_setinheritance(Command): class cmd_fetch(Command): """Download a GPO""" - synopsis = "%prog gpo fetch [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -732,7 +732,7 @@ class cmd_fetch(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'gpo' ] + takes_args = ['gpo'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), @@ -792,7 +792,7 @@ class cmd_fetch(Command): class cmd_create(Command): """Create an empty GPO""" - synopsis = "%prog gpo create [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -800,7 +800,7 @@ class cmd_create(Command): "credopts": options.CredentialsOptions, } - takes_args = [ 'displayname' ] + takes_args = ['displayname'] takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py index db2a6d6269..ed8c318db1 100644 --- a/source4/scripting/python/samba/netcmd/group.py +++ b/source4/scripting/python/samba/netcmd/group.py @@ -43,7 +43,7 @@ distribution_group = dict({"Domain": GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP, "Glo class cmd_group_add(Command): """Creates a new group""" - synopsis = "%prog group add [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -88,7 +88,7 @@ class cmd_group_add(Command): class cmd_group_delete(Command): """Delete a group""" - synopsis = "%prog group delete [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -115,7 +115,7 @@ class cmd_group_delete(Command): class cmd_group_add_members(Command): """Add (comma-separated list of) group members""" - synopsis = "%prog group addmembers [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -144,7 +144,7 @@ class cmd_group_add_members(Command): class cmd_group_remove_members(Command): """Remove (comma-separated list of) group members""" - synopsis = "%prog group removemembers [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, diff --git a/source4/scripting/python/samba/netcmd/ldapcmp.py b/source4/scripting/python/samba/netcmd/ldapcmp.py index 7805eca6cf..78e6fd356b 100755 --- a/source4/scripting/python/samba/netcmd/ldapcmp.py +++ b/source4/scripting/python/samba/netcmd/ldapcmp.py @@ -850,7 +850,7 @@ class LDAPBundel(object): class cmd_ldapcmp(Command): """compare two ldap databases""" - synopsis = "%prog ldapcmp (domain|configuration|schema) [options]" + synopsis = "%prog (domain|configuration|schema) [options]" takes_optiongroups = { "sambaopts": options.SambaOptions, diff --git a/source4/scripting/python/samba/netcmd/ntacl.py b/source4/scripting/python/samba/netcmd/ntacl.py index 42187493b8..2e5b0c69aa 100644 --- a/source4/scripting/python/samba/netcmd/ntacl.py +++ b/source4/scripting/python/samba/netcmd/ntacl.py @@ -41,7 +41,7 @@ from samba.netcmd import ( class cmd_ntacl_set(Command): """Set ACLs on a file""" - synopsis = "%prog set [options]" + synopsis = "%prog [options]" takes_options = [ Option("--quiet", help="Be quiet", action="store_true"), @@ -77,7 +77,7 @@ class cmd_ntacl_set(Command): class cmd_ntacl_get(Command): """Set ACLs on a file""" - synopsis = "%prog get [options]" + synopsis = "%prog [options]" takes_options = [ Option("--as-sddl", help="Output ACL in the SDDL format", action="store_true"), diff --git a/source4/scripting/python/samba/netcmd/rodc.py b/source4/scripting/python/samba/netcmd/rodc.py index b2a5e3f720..77d469a5dd 100644 --- a/source4/scripting/python/samba/netcmd/rodc.py +++ b/source4/scripting/python/samba/netcmd/rodc.py @@ -25,15 +25,13 @@ from samba.samdb import SamDB from samba.auth import system_session import ldb from samba.dcerpc import misc, drsuapi -from samba.credentials import Credentials from samba.drs_utils import drs_Replicate - class cmd_rodc_preload(Command): """Preload one account for an RODC""" - synopsis = "%prog rodc preload (||) [options]" + synopsis = "%prog (||) [options]" takes_options = [ Option("--server", help="DC to use", type=str), diff --git a/source4/scripting/python/samba/netcmd/spn.py b/source4/scripting/python/samba/netcmd/spn.py index 614710c973..0f01a49fc4 100644 --- a/source4/scripting/python/samba/netcmd/spn.py +++ b/source4/scripting/python/samba/netcmd/spn.py @@ -33,11 +33,10 @@ from samba.netcmd import ( ) - class cmd_spn_list(Command): """List spns of a given user.""" - synopsis = "%prog spn list [options]" + synopsis = "%prog [options]" takes_args = ["user"] @@ -71,11 +70,10 @@ class cmd_spn_list(Command): raise CommandError("User %s not found" % user) - class cmd_spn_add(Command): """Create a new spn.""" - synopsis = "%prog spn add [options]" + synopsis = "%prog [options]" takes_options = [ Option("--force", help="Force the addition of the spn"\ @@ -126,11 +124,10 @@ class cmd_spn_add(Command): raise CommandError("User %s not found" % user) - class cmd_spn_delete(Command): """Delete a spn.""" - synopsis = "%prog spn delete [user] [options]" + synopsis = "%prog [user] [options]" takes_args = ["name", "user?"] @@ -181,7 +178,6 @@ class cmd_spn_delete(Command): raise CommandError("Service principal %s not affected" % name) - class cmd_spn(SuperCommand): """Service Principal Name (SPN) management""" diff --git a/source4/scripting/python/samba/netcmd/testparm.py b/source4/scripting/python/samba/netcmd/testparm.py index b69c351538..517196652b 100755 --- a/source4/scripting/python/samba/netcmd/testparm.py +++ b/source4/scripting/python/samba/netcmd/testparm.py @@ -44,7 +44,7 @@ from samba.netcmd import Command, CommandError, Option class cmd_testparm(Command): """Syntax check the configuration file.""" - synopsis = "%prog testparm [options]" + synopsis = "%prog [options]" takes_optiongroups = { "sambaopts" : options.SambaOptions, diff --git a/source4/scripting/python/samba/netcmd/time.py b/source4/scripting/python/samba/netcmd/time.py index 31a6f7c627..62d4d1ba3c 100644 --- a/source4/scripting/python/samba/netcmd/time.py +++ b/source4/scripting/python/samba/netcmd/time.py @@ -29,7 +29,7 @@ from samba.netcmd import ( class cmd_time(Command): """Retrieve the time on a remote server""" - synopsis = "%prog time [server-name] [options]" + synopsis = "%prog [server-name] [options]" takes_args = ["server_name?"] diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index 215fd15533..cbac5affbe 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -36,11 +36,10 @@ from samba.netcmd import ( ) - class cmd_user_add(Command): """Creates a new user""" - synopsis = "%prog user add [] [options]" + synopsis = "%prog [] [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -107,7 +106,7 @@ class cmd_user_add(Command): class cmd_user_delete(Command): """Delete a user""" - synopsis = "%prog user delete [options]" + synopsis = "%prog [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -133,7 +132,7 @@ class cmd_user_delete(Command): class cmd_user_enable(Command): """Enables a user""" - synopsis = "%prog user enable (|--filter ) [options]" + synopsis = "%prog (|--filter ) [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -166,7 +165,7 @@ class cmd_user_enable(Command): class cmd_user_setexpiry(Command): """Sets the expiration of a user account""" - synopsis = "%prog user setexpiry (|--filter ) [options]" + synopsis = "%prog (|--filter ) [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -205,7 +204,7 @@ class cmd_user_setexpiry(Command): class cmd_user_password(Command): """Change password for a user account (the one provided in authentication)""" - synopsis = "%prog user password [options]" + synopsis = "%prog [options]" takes_options = [ Option("--newpassword", help="New password", type=str), @@ -239,7 +238,7 @@ class cmd_user_password(Command): class cmd_user_setpassword(Command): """(Re)sets the password of a user account""" - synopsis = "%prog user setpassword (|--filter ) [options]" + synopsis = "%prog (|--filter ) [options]" takes_options = [ Option("-H", "--URL", help="LDB URL for database or target server", type=str, @@ -286,7 +285,6 @@ class cmd_user_setpassword(Command): self.outf.write("Changed password OK\n") - class cmd_user(SuperCommand): """User management""" diff --git a/source4/scripting/python/samba/netcmd/vampire.py b/source4/scripting/python/samba/netcmd/vampire.py index dc522ff5d1..22a180a700 100644 --- a/source4/scripting/python/samba/netcmd/vampire.py +++ b/source4/scripting/python/samba/netcmd/vampire.py @@ -30,9 +30,10 @@ from samba.netcmd import ( CommandError ) + class cmd_vampire(Command): """Join and synchronise a remote AD domain to the local server""" - synopsis = "%prog vampire [options] " + synopsis = "%prog [options] " takes_options = [ Option("--target-dir", help="Target directory.", type=str), -- cgit