From bde7ab7bac3daba37b575c664966c755afe89299 Mon Sep 17 00:00:00 2001 From: EpocDotFr Date: Mon, 9 Sep 2024 23:05:44 +0200 Subject: [PATCH] Remove "--watch" from "build" command, move to new "watch" command --- staticjinjaplus/cli.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/staticjinjaplus/cli.py b/staticjinjaplus/cli.py index 3715668..dd263da 100644 --- a/staticjinjaplus/cli.py +++ b/staticjinjaplus/cli.py @@ -170,12 +170,9 @@ def cli() -> None: command_arg_parser = arg_parser.add_subparsers(dest='command', required=True) - build_arg_parser = command_arg_parser.add_parser('build', help='Build the site') - build_arg_parser.add_argument( - '-w', '--watch', - help='Automatically rebuild the site when templates are modified', - action='store_true' - ) + command_arg_parser.add_parser('build', help='Build the site') + + command_arg_parser.add_parser('watch', help='Build the site and watch for templates changes') command_arg_parser.add_parser('clean', help='Delete and recreate the output directory') @@ -186,7 +183,9 @@ def cli() -> None: args = arg_parser.parse_args() if args.command == 'build': - build(args.watch) + build() + elif args.command == 'watch': + build(True) elif args.command == 'clean': clean() elif args.command == 'publish':