change names of commands and make it positional

This commit is contained in:
Ville Rantanen
2023-01-03 12:35:48 +02:00
parent 80af969dc5
commit 5a9b52f65c
2 changed files with 6 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ class Mirva:
)
)
if self.run_commands["generator"]:
if self.run_commands["build"]:
self.get_config()
self.create_posts()
self.write_index()
@@ -202,11 +202,11 @@ class Mirva:
help="Force regeneration of middle sized images",
)
parser.add_argument(
"--command",
"-c",
default="all",
dest="command",
action="store",
choices=["all", "config", "generator"],
nargs="?",
choices=["all", "config", "build"],
help="Run only part of the process. Defaults to all. Config is run always if it doesn't exist.",
)
@@ -215,8 +215,7 @@ class Mirva:
"config": self.options.command == "config"
or self.options.command == "all"
or not os.path.exists(self.config_file),
"generator": self.options.command == "generator"
or self.options.command == "all",
"build": self.options.command == "build" or self.options.command == "all",
}
def get_index(self, posts):