diff options
author | Giampaolo Lauria <lauria2@yahoo.com> | 2011-07-18 10:03:16 -0400 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-07-21 11:44:30 +1000 |
commit | 8e0a86056139281b2e1ad7763e51cf804e38a77e (patch) | |
tree | baf73beef9870f32933e3090113c2825b7ac94af /source4 | |
parent | 7c8b53a49ed5fc6d811eafe15ffd247d06404946 (diff) | |
download | samba-8e0a86056139281b2e1ad7763e51cf804e38a77e.tar.gz |
samba-tool: improved Option list for all user commands
Added metavar values for -H and added some default values for other options
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/netcmd/user.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index ba852636340..3b772de87a1 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -83,7 +83,7 @@ class cmd_user_enable(Command): synopsis = "%prog user enable (<username>|--filter <filter>) [options]" takes_options = [ - Option("-H", help="LDB URL for database or target server", type=str), + Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"), Option("--filter", help="LDAP Filter to set password on", type=str), ] @@ -116,10 +116,10 @@ class cmd_user_setexpiry(Command): synopsis = "%prog user setexpiry (<username>|--filter <filter>) [options]" takes_options = [ - Option("-H", help="LDB URL for database or target server", type=str), + Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"), Option("--filter", help="LDAP Filter to set password on", type=str), - Option("--days", help="Days to expiry", type=int), - Option("--noexpiry", help="Password does never expire", action="store_true"), + Option("--days", help="Days to expiry", type=int, default=0), + Option("--noexpiry", help="Password does never expire", action="store_true", default=False), ] takes_args = ["username?"] @@ -134,9 +134,6 @@ class cmd_user_setexpiry(Command): lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp) - if days is None: - days = 0 - samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp) @@ -154,12 +151,12 @@ class cmd_user_setpassword(Command): synopsis = "%prog user setpassword (<username>|--filter <filter>) [options]" takes_options = [ - Option("-H", help="LDB URL for database or target server", type=str), + Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"), Option("--filter", help="LDAP Filter to set password on", type=str), Option("--newpassword", help="Set password", type=str), Option("--must-change-at-next-login", - help="Force password to be changed on next login", - action="store_true"), + help="Force password to be changed on next login", + action="store_true"), ] takes_args = ["username?"] |