diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-30 22:59:57 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-30 23:09:30 +0100 |
commit | 012b18554e5e6a408a11a7157a30c5d068f2d3d1 (patch) | |
tree | 50c70342106c2674d61b5559f7dfa89dc1f506bc /utils/cmdline.py | |
parent | d0482fb56654037d01feb0f7a27206aefacf7112 (diff) |
Initial version of a chsh.ldap utility
Diffstat (limited to 'utils/cmdline.py')
-rw-r--r-- | utils/cmdline.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/cmdline.py b/utils/cmdline.py index eb84fe3..3d7d58f 100644 --- a/utils/cmdline.py +++ b/utils/cmdline.py @@ -48,3 +48,21 @@ class VersionAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): print version_string parser.exit() + + +class ListShellsAction(argparse.Action): + + def __init__(self, option_strings, dest, + help='list the shells found in /etc/shells'): + super(ListShellsAction, self).__init__( + option_strings=option_strings, + dest=argparse.SUPPRESS, + default=argparse.SUPPRESS, + nargs=0, + help=help) + + def __call__(self, parser, namespace, values, option_string=None): + import shells + for shell in shells.list_shells(): + print shell + parser.exit() |