From 6402f43ac5bbaf22916c76703c19184a794c757d Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 8 Apr 2005 02:02:10 +0000 Subject: [PATCH] Actually make use of the clean option. --- scripts/supybot-plugin-doc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/supybot-plugin-doc b/scripts/supybot-plugin-doc index 5f1c24f61..e98e7cb42 100644 --- a/scripts/supybot-plugin-doc +++ b/scripts/supybot-plugin-doc @@ -30,6 +30,7 @@ ### import os +import shutil import supybot @@ -185,8 +186,8 @@ if __name__ == '__main__': parser = optparse.OptionParser(usage='Usage: %prog [options] [plugins]', version='Supybot %s' % conf.version) parser.add_option('-c', '--clean', action='store_true', default=False, - dest='clean', help='Cleans the various data/conf/logs' - 'directories before running tests.') + dest='clean', help='Cleans the various data/conf/logs ' + 'directories after generating the docs.') parser.add_option('--no-escape', action='store_false', default=True, dest='escape', help='Disables escaping of html entities e.g., < as ' @@ -194,7 +195,7 @@ if __name__ == '__main__': parser.add_option('--plugins-dir', action='append', dest='pluginsDirs', default=[], help='Looks in in the given directory for plugins and ' - 'loads the tests from all of them.') + 'generates documentation for all of them.') (options, args) = parser.parse_args() # This must go before checking for args, of course. @@ -228,4 +229,9 @@ if __name__ == '__main__': for Plugin in plugins: genDoc(Plugin, options.escape) + if options.clean: + shutil.rmtree(conf.supybot.directories.log()) + shutil.rmtree(conf.supybot.directories.conf()) + shutil.rmtree(conf.supybot.directories.data()) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=78: