diff --git a/hyde/cli.py b/hyde/cli.py index e69de29..60dc73f 100644 --- a/hyde/cli.py +++ b/hyde/cli.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +""" +The command line interface for hyde. +""" +import argparse + +from engine import init, gen, serve +from version import __version__ + +def main(): + """ + The main function called by hyde executable + """ + parser = argparse.ArgumentParser(description='hyde - A Python Static Website Generator', + epilog='Use %(prog)s {command} -h to get help on individual commands') + parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__) + parser.add_argument('-s', '--sitepath', action='store', default='.', help="Location of the hyde site") + subcommands = parser.add_subparsers(title="Hyde commands", + description="Entry points for hyde") + init_command = subcommands.add_parser('init', help='Initializes a new hyde site') + init_command.set_defaults(run=init) + init_command.add_argument('-f', '--force', action='store_true', default=False, dest='force', + help='Overwrite the current site if it exists') + args = parser.parse_args() + args.run(args) \ No newline at end of file diff --git a/hyde/engine.py b/hyde/engine.py new file mode 100644 index 0000000..1fae386 --- /dev/null +++ b/hyde/engine.py @@ -0,0 +1,7 @@ +def init(args): + print args.sitepath + print args.force + +def gen(args): pass + +def serve(args): pass \ No newline at end of file diff --git a/hyde/hyde.py b/hyde/hyde.py index e69de29..7502bbf 100644 --- a/hyde/hyde.py +++ b/hyde/hyde.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +The hyde executable +""" +from cli import main + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/hyde/version.py b/hyde/version.py new file mode 100644 index 0000000..519bfa2 --- /dev/null +++ b/hyde/version.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +""" +Handles hyde version +TODO: Use fabric like versioning scheme +""" +__version__ = '0.6.0' \ No newline at end of file