# HG changeset patch
# User Pascal Volk <user@localhost.localdomain.org>
# Date 1402247515 0
# Node ID 9d739cd2f527acbf3e1a4b32007c63d8b8f84854
# Parent  8931c6b8435eb4e75d9b027f176b72485539f08e
VMM/cli/subcommands: userdelete: Added option --delete-home.

diff -r 8931c6b8435e -r 9d739cd2f527 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')