Open wandernauta opened 14 years ago
I'd like that feature as well. Sucks typing -i, -g etc. Maybe creating a default fab file would be the quickest way to solve this. http://stevelosh.com/blog/2010/01/moving-from-django-to-hyde/
Using fabfiles would add an additional dependency on Fabric (which in turn depends on PyCrypto and so on). I'm afraid it might be considered overkill. Changing
if len(args):
parser.error("Unexpected arguments encountered.")
to
if len(args):
if (args[0] == 'serve'):
options.webserve = True
else:
findplugin(args[0]).run(args)
# ...
might do the trick as well, right?
Agreed.
Would the following work?
if len(args):
if (args[0] in ('generate', 'g', 'gen')):
options.generate = True
elif (args[0] in ('serve', 'w', 'srv')):
options.webserve = True
elif (args[0] in ('init', 'create', 'i')): # 'Create' seems to be what Webgen calls it
options.init = True
elif (os.path.isfile(PROG_ROOT + os.sep + "plugins" + os.sep + args[0] + ".py")):
# Plugin-running code here
pass
else:
parser.error("Unexpected arguments encountered.")
Since every option to hyde is a subcommand, I would rather have something like:
command = load_command(args[0]) if not command: # handle bad command command.execute(args[1:])
Using something like http://code.google.com/p/argparse/ might also make this simpler.
Great idea :D
I'd like Hyde to take Git/webgen style commands as well, e.g.
hyde.py init
andhyde.py serve
.This could also be a beginning of a plugin system -
hyde.py foo
could try to run a script calledfoo.py
in aplugins
directory inside the main Hyde directory.