diff --git a/Makefile b/Makefile index 502b475..d0c9373 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,22 @@ MASTER_VERSION := $(shell grep '^version = .*$$' pyproject.toml | awk '{print $$3}') all: README.md -README.md: README.bashdown bashdown +README.md: README.bashdown bashdown README.bashdown > README.md build: -rm -r ./dist/* poetry build +tidy: + black bashdown/ + pylint bashdown/ + test: python3 -m unittest version: sed -i "s/^__version__ = .*$$/__version__ = \"$(MASTER_VERSION)\"/g" bashdown/__init__.py -upload: - twine upload dist/* +publish: + poetry publish diff --git a/README.md b/README.md index 01b6085..a95ea6b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Processes in-line bash in markdown files positional arguments: filename -options: +optional arguments: -h, --help show this help message and exit For more information please see the docs diff --git a/bashdown/__init__.py b/bashdown/__init__.py index ecd7575..d1f57ef 100644 --- a/bashdown/__init__.py +++ b/bashdown/__init__.py @@ -9,7 +9,7 @@ import subprocess import sys -__version__ = "0.4.0" +__version__ = "0.5.0" def process_content(input_lines): @@ -48,16 +48,25 @@ def process_content(input_lines): def cli_arg_parser(args=None): + """ + Parses cli arguments for the command cli tool + """ parser = argparse.ArgumentParser( prog="bashdown", - description="Processes in-line bash in markdown files", + # description="Processes in-line bash in markdown files", epilog="For more information please see the docs", ) - parser.add_argument("filename") + # group = parser.add_mutually_exclusive_group(required=True) + # group = parser.add_mutually_exclusive_group() + parser.add_argument("filename", help="File to process") + parser.add_argument('-v', '--version', action='version', version= __version__) return parser.parse_args(args) def main(): + """ + Kicks everything off for the cli tool + """ args = cli_arg_parser(sys.argv[1:]) with open(args.filename, "r", encoding="utf8") as file: diff --git a/pyproject.toml b/pyproject.toml index e770e25..9828183 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bashdown" -version = "0.4.0" +version = "0.5.0" description = "Executes in-line bash in markdown files" authors = ["Mark Sellors "] readme = "README.md"