supybot-plugin-create: Added --desc short description option.

This commit is contained in:
Julian Paul Glass 2014-11-25 11:51:37 +00:00
parent cbe579ec2d
commit 09c01e0467

View File

@ -151,7 +151,7 @@ __init__Template = '''
%s %s
""" """
%s %s: %s
""" """
import supybot import supybot
@ -219,6 +219,8 @@ def main():
parser.add_option('', '--real-name', action='store', dest='realName', parser.add_option('', '--real-name', action='store', dest='realName',
help='Determines what real name the copyright is ' help='Determines what real name the copyright is '
'assigned to.') 'assigned to.')
parser.add_option('', '--desc', action='store', dest='desc',
help='Short description of plugin.')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if options.name: if options.name:
name = options.name name = options.name
@ -258,6 +260,11 @@ def main():
if not yn('Do you wish to use Supybot\'s license for your plugin?'): if not yn('Do you wish to use Supybot\'s license for your plugin?'):
license = '#' license = '#'
if not options.desc:
options.desc = something(textwrap.dedent("""
Please provide a short description of the plugin.
""").strip())
if threaded: if threaded:
threaded = 'threaded = True' threaded = 'threaded = True'
else: else:
@ -286,7 +293,7 @@ def main():
name, threaded, name)) name, threaded, name))
writeFile('config.py', configTemplate % (copyright, name, name, name, name, writeFile('config.py', configTemplate % (copyright, name, name, name, name,
name)) name))
writeFile('__init__.py', __init__Template % (copyright, name)) writeFile('__init__.py', __init__Template % (copyright, name, options.desc))
writeFile('test.py', testTemplate % (copyright, name, name)) writeFile('test.py', testTemplate % (copyright, name, name))
writeFile('README.md', readmeTemplate) writeFile('README.md', readmeTemplate)