summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorGiampaolo Lauria <lauria2@yahoo.com>2011-07-18 10:03:16 -0400
committerAndrew Tridgell <tridge@samba.org>2011-07-21 11:44:30 +1000
commit8e0a86056139281b2e1ad7763e51cf804e38a77e (patch)
treebaf73beef9870f32933e3090113c2825b7ac94af /source4/scripting
parent7c8b53a49ed5fc6d811eafe15ffd247d06404946 (diff)
downloadsamba-8e0a86056139281b2e1ad7763e51cf804e38a77e.tar.gz
samba-8e0a86056139281b2e1ad7763e51cf804e38a77e.tar.bz2
samba-8e0a86056139281b2e1ad7763e51cf804e38a77e.zip
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/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/user.py17
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 ba85263634..3b772de87a 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?"]