VMM/cli/subcommands: domaindelete: Added option --delete-directory. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Mon, 09 Jun 2014 17:37:36 +0000
branchv0.7.x
changeset 754 8363ea6240a5
parent 753 3f1cecdcdfca
child 755 e99e4fc62a5f
VMM/cli/subcommands: domaindelete: Added option --delete-directory.
VirtualMailManager/cli/subcommands.py
--- a/VirtualMailManager/cli/subcommands.py	Mon Jun 09 17:34:31 2014 +0000
+++ b/VirtualMailManager/cli/subcommands.py	Mon Jun 09 17:37:36 2014 +0000
@@ -179,7 +179,8 @@
 
 def domain_delete(ctx):
     """delete the given domain and all its alias domains"""
-    ctx.hdlr.domain_delete(ctx.args.fqdn.lower(), ctx.args.force)
+    ctx.hdlr.domain_delete(ctx.args.fqdn.lower(), ctx.args.delete_directory,
+                           ctx.args.force)
 
 
 def domain_info(ctx):
@@ -721,15 +722,19 @@
     dd = a('domaindelete', aliases=('dd',),
            help=_('delete the given domain and all its alias domains'),
            epilog=fill(_("This subcommand deletes the domain specified by "
-               "fqdn.\n\nIf there are accounts, aliases and/or relocated "
-               "users assigned to the given domain, vmm will abort the "
-               "requested operation and show an error message. If you know, "
-               "what you are doing, you can specify the optional argument "
-               "--force.\n\nIf you really always know what you are doing, "
-               "edit your vmm.cfg and set the option domain.force_deletion "
-               "to true.")),
+               "fqdn.\n\nWhen the --delete-directory option is given, vmm "
+               "will delete the directory of the given domain. This overrides "
+               "the domain.delete_directory setting of vmm.cfg.\n\nIf there "
+               "are accounts, aliases and/or relocated users assigned to the "
+               "given domain, vmm will abort the requested operation and show "
+               "an error message. If you know, what you are doing, you can "
+               "specify the optional argument --force.\n\nIf you really "
+               "always know what you are doing, edit your vmm.cfg and set the "
+               "option domain.force_deletion to true.")),
            formatter_class=RawDescriptionHelpFormatter)
     dd.add_argument('fqdn', help=_('a fully qualified domain name'))
+    dd.add_argument('--delete-directory', action='store_true',
+                    help="delete the domain's directory recursively")
     dd.add_argument('--force', action='store_true',
                     help=_('also delete all accounts, aliases and/or '
                            'relocated users'))