diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-01-31 11:24:52 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-01-31 11:24:52 -0500 |
commit | 5834ada3e9f4f1052f4846bcb576f2134453a233 (patch) | |
tree | 0c95a0ed7d4a4e6a3a77ce7befbf8c80d439430c /ipa-admintools/ipa-moduser | |
parent | 64cce8f82e08f0716eec3fd4c1f3c0fccf309fba (diff) | |
download | freeipa-5834ada3e9f4f1052f4846bcb576f2134453a233.tar.gz freeipa-5834ada3e9f4f1052f4846bcb576f2134453a233.tar.xz freeipa-5834ada3e9f4f1052f4846bcb576f2134453a233.zip |
Add option to list common attributes for use with --setattr,--addattr,--delattr
Diffstat (limited to 'ipa-admintools/ipa-moduser')
-rw-r--r-- | ipa-admintools/ipa-moduser | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipa-admintools/ipa-moduser b/ipa-admintools/ipa-moduser index 6b19ff50..dd909c90 100644 --- a/ipa-admintools/ipa-moduser +++ b/ipa-admintools/ipa-moduser @@ -32,6 +32,7 @@ import ldap import errno def usage(): + print "ipa-moduser [--list]" print "ipa-moduser [-a|--activate] [-c|--gecos STRING] [-d|--directory STRING] [-f|--firstname STRING] [-l|--lastname STRING] [-s|--shell STRING] [--addattr attribute=value] [--delattr attribute] [--setattr attribute=value] user" sys.exit(1) @@ -60,6 +61,8 @@ def parse_options(): parser.add_option("--setattr", dest="setattr", help="Set an attribute, dropping any existing values that may exist", action="append") + parser.add_option("--list", dest="list", action="store_true", + help="List common attributes (this is not an exhaustive list)") parser.add_option("-M", "--mailAddress", dest="mail", help="Set user's e-mail address") parser.add_option("--usage", action="store_true", @@ -86,6 +89,14 @@ def main(): options, args = parse_options() + if options.list: + client = ipaclient.IPAClient() + list = client.get_all_attrs() + + for x in list: + print x + return 0 + if options.usage or len(args) != 2: usage() |