VMM/cli/subcommands: userdelete: Added option --delete-home. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Sun, 08 Jun 2014 17:11:55 +0000
branchv0.7.x
changeset 751 9d739cd2f527
parent 750 8931c6b8435e
child 752 271bd82c05c0
VMM/cli/subcommands: userdelete: Added option --delete-home.
VirtualMailManager/cli/subcommands.py
--- a/VirtualMailManager/cli/subcommands.py	Sun Jun 08 17:08:35 2014 +0000
+++ b/VirtualMailManager/cli/subcommands.py	Sun Jun 08 17:11:55 2014 +0000
@@ -348,7 +348,8 @@
 
 def user_delete(ctx):
     """delete the specified user"""
-    ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.force)
+    ctx.hdlr.user_delete(ctx.args.address.lower(), ctx.args.delete_home,
+                         ctx.args.force)
 
 
 def user_info(ctx):
@@ -906,13 +907,18 @@
     ud = a('userdelete', aliases=('ud',),
            help=_('delete the specified user'),
            epilog=fill(_('Use this subcommand to delete the account with the '
-               'given address.\n\nIf there are one or more aliases with an '
-               'identical destination address, vmm will abort the requested '
-               'operation and show an error message. To prevent this, '
-               'give the optional argument --force.')),
+               'given address.\n\nWhen the --delete-home option is present, '
+               'vmm will also delete the account\'s home directory. This '
+               'overrides the account.delete_directory setting of vmm.cfg.\n\n'
+               'If there are one or more aliases with an identical '
+               'destination address, vmm will abort the requested operation '
+               'and show an error message. To prevent this, give the optional '
+               'argument --force.')),
            formatter_class=RawDescriptionHelpFormatter)
     ud.add_argument('address',
                     help=_("an account's e-mail address (local-part@fqdn)"))
+    ud.add_argument('--delete-home', action='store_true',
+                    help=_("delete the account's home directory"))
     ud.add_argument('--force', action='store_true',
                     help=_('also delete assigned alias addresses'))
     ud.set_defaults(func=user_delete, scmd='userdelete')