diff options
author | neodarz <neodarz@neodarz.net> | 2019-05-26 16:40:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-05-26 16:40:34 +0200 |
commit | 12e05d77288c39f262322eaee36faf3d0b31c781 (patch) | |
tree | 177ecdffd5f6bbedd651eb6b10df714e1383981e | |
parent | f3600fccc4a02324b5cc86549e644720097c61df (diff) | |
download | my_new_personal_website-12e05d77288c39f262322eaee36faf3d0b31c781.tar.xz my_new_personal_website-12e05d77288c39f262322eaee36faf3d0b31c781.zip |
Move new_post_cli to external file
Diffstat (limited to '')
-rw-r--r-- | cli/cli.py | 5 | ||||
-rwxr-xr-x | pyblog | 7 |
2 files changed, 6 insertions, 6 deletions
@@ -77,3 +77,8 @@ def new_post(title): edit_post_with_editor(fullpath) return 0 + + +def new_post_cli(args): + """CLI wrapper around new_post.""" + new_post(args.title) @@ -53,11 +53,6 @@ from generators import generators from cli import cli -def new_post_cli(args): - """CLI wrapper around new_post.""" - cli.new_post(args.title) - - def touch(filename): """Update the timestamp of a post to the current time.""" filename = os.path.basename(filename) @@ -559,7 +554,7 @@ def main(): "new_post", aliases=["n", "new"], description="Create a new post with metadata pre-filled.") parser_new_post.add_argument("title", help="title of the new post") - parser_new_post.set_defaults(func=new_post_cli) + parser_new_post.set_defaults(func=cli.new_post_cli) parser_new_post = subparsers.add_parser( "touch", aliases=["t", "tou"], |