diff --git a/.moban.cd/changelog.yml b/.moban.cd/changelog.yml index b3584f87..34a1b424 100644 --- a/.moban.cd/changelog.yml +++ b/.moban.cd/changelog.yml @@ -1,6 +1,12 @@ name: moban organisation: moremoban releases: + - changes: + - action: Updated + details: + - "Command options have been grouped. --template_type became --template-type" + date: tbd + version: 0.6.4 - changes: - action: Added details: diff --git a/.moban.cd/moban.yml b/.moban.cd/moban.yml index 5853522c..2432172b 100644 --- a/.moban.cd/moban.yml +++ b/.moban.cd/moban.yml @@ -4,8 +4,8 @@ organisation: moremoban author: C. W. contact: wangc_2011@hotmail.com license: MIT -version: 0.6.3 -current_version: 0.6.3 +version: 0.6.4 +current_version: 0.6.4 release: 0.6.3 branch: master master: index diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bf1a2951..f973bb29 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.6.4 - tbd +-------------------------------------------------------------------------------- + +Updated +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. Command options have been grouped. --template_type became --template-type + 0.6.3 - 25.09.2019 -------------------------------------------------------------------------------- diff --git a/docs/conf.py b/docs/conf.py index 7378f931..5c3cd9e0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ copyright = '2017-2019 Onni Software Ltd.' author = 'C. W.' # The short X.Y version -version = '0.6.3' +version = '0.6.4' # The full version, including alpha/beta/rc tags release = '0.6.3' diff --git a/moban/_version.py b/moban/_version.py index ed642873..a83896a5 100644 --- a/moban/_version.py +++ b/moban/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.6.3" +__version__ = "0.6.4" __author__ = "C. W." diff --git a/moban/constants.py b/moban/constants.py index d726f084..9b4277e5 100644 --- a/moban/constants.py +++ b/moban/constants.py @@ -7,7 +7,7 @@ # Configurations PROGRAM_NAME = "moban" PROGRAM_DESCRIPTION = ( - "Yet another jinja2 cli command for static " + "text generation" + "Static text generator using any template, any data and any location." ) DEFAULT_YAML_SUFFIX = ".yml" # .moban.yml, default moban configuration file diff --git a/moban/main.py b/moban/main.py index 96f3e569..e855d5a5 100644 --- a/moban/main.py +++ b/moban/main.py @@ -89,80 +89,89 @@ def create_parser(): prog=constants.PROGRAM_NAME, description=constants.PROGRAM_DESCRIPTION ) parser.add_argument( - "-cd", - "--%s" % constants.LABEL_CONFIG_DIR, - help="the directory for configuration file lookup", + "-c", "--%s" % constants.LABEL_CONFIG, help="the data file" + ) + parser.add_argument( + "-t", "--%s" % constants.LABEL_TEMPLATE, help="the template file" ) parser.add_argument( - "-c", "--%s" % constants.LABEL_CONFIG, help="the dictionary file" + "-o", "--%s" % constants.LABEL_OUTPUT, help="the output file" ) parser.add_argument( + constants.POSITIONAL_LABEL_TEMPLATE, + metavar="template", + type=str, + nargs="?", + help="string templates", + ) + advanced = parser.add_argument_group( + "Advanced options", "For better control" + ) + advanced.add_argument( "-td", "--%s" % constants.LABEL_TMPL_DIRS, nargs="*", - help="the directories for template file lookup", + help="add more directories for template file lookup", ) - parser.add_argument( - "-t", "--%s" % constants.LABEL_TEMPLATE, help="the template file" + advanced.add_argument( + "-cd", + "--%s" % constants.LABEL_CONFIG_DIR, + help="the directory for configuration file lookup", ) - parser.add_argument( - "-o", "--%s" % constants.LABEL_OUTPUT, help="the output file" + advanced.add_argument( + "-m", "--%s" % constants.LABEL_MOBANFILE, help="custom moban file" ) - parser.add_argument( - "--%s" % constants.LABEL_TEMPLATE_TYPE, + advanced.add_argument( + "-g", "--%s" % constants.LABEL_GROUP, help="a subset of targets" + ) + advanced.add_argument( + "--%s" % constants.LABEL_TEMPLATE_TYPE.replace("_", "-"), help="the template type, default is jinja2", ) - parser.add_argument( + advanced.add_argument( + "-d", + "--%s" % constants.LABEL_DEFINE, + nargs="+", + help=( + "to supply additional or override predefined variables," + + " format: VAR=VALUEs" + ), + ) + advanced.add_argument( + "-e", + "--%s" % constants.LABEL_EXTENSION, + nargs="+", + help="to to TEMPLATE_TYPE=EXTENSION_NAME", + ) + advanced.add_argument( "-f", action="store_true", dest=constants.LABEL_FORCE, default=False, help="force moban to template all files despite of .moban.hashes", ) - parser.add_argument( + developer = parser.add_argument_group( + "Developer options", "For debugging and development" + ) + developer.add_argument( "--%s" % constants.LABEL_EXIT_CODE, action="store_true", dest=constants.LABEL_EXIT_CODE, default=False, help="tell moban to change exit code", ) - parser.add_argument( - "-m", "--%s" % constants.LABEL_MOBANFILE, help="custom moban file" - ) - parser.add_argument( - "-g", "--%s" % constants.LABEL_GROUP, help="a subset of targets" - ) - parser.add_argument( - constants.POSITIONAL_LABEL_TEMPLATE, - metavar="template", - type=str, - nargs="?", - help="string templates", - ) - parser.add_argument( + developer.add_argument( "-V", "--%s" % constants.LABEL_VERSION, action="version", version="%(prog)s {v}".format(v=__version__), ) - parser.add_argument( + developer.add_argument( "-v", action="count", dest=constants.LABEL_VERBOSE, default=0, - help="show verbose", - ) - parser.add_argument( - "-d", - "--%s" % constants.LABEL_DEFINE, - nargs="+", - help="to take a list of VAR=VALUEs", - ) - parser.add_argument( - "-e", - "--%s" % constants.LABEL_EXTENSION, - nargs="+", - help="to add an extension to TEMPLATE_TYPE=EXTENSION_NAME", + help="show verbose, try -v, -vv", ) return parser diff --git a/setup.py b/setup.py index 08b37c05..f7482386 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ NAME = "moban" AUTHOR = "C. W." -VERSION = "0.6.3" +VERSION = "0.6.4" EMAIL = "wangc_2011@hotmail.com" LICENSE = "MIT" ENTRY_POINTS = {