From 5a9b52f65c747fde9f488e9bbc47c26fa1f132fe Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Tue, 3 Jan 2023 12:35:48 +0200 Subject: [PATCH] change names of commands and make it positional --- mirva/__init__.py | 2 +- mirva/mirva.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mirva/__init__.py b/mirva/__init__.py index 89d320b..08738ad 100644 --- a/mirva/__init__.py +++ b/mirva/__init__.py @@ -1,4 +1,4 @@ -__version__ = "20220823.0" +__version__ = "20230103.0" def get_version(): diff --git a/mirva/mirva.py b/mirva/mirva.py index 7def873..9d20e03 100755 --- a/mirva/mirva.py +++ b/mirva/mirva.py @@ -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):