feat: turn boolean settings into CLI flags
This commit is contained in:
@@ -213,6 +213,7 @@ class Settings(BaseSettings):
|
||||
toml_file="config.toml",
|
||||
env_prefix="HERETIC_",
|
||||
cli_parse_args=True,
|
||||
cli_implicit_flags=True,
|
||||
cli_kebab_case=True,
|
||||
)
|
||||
|
||||
|
||||
+5
-4
@@ -65,10 +65,11 @@ def run():
|
||||
print()
|
||||
|
||||
if (
|
||||
# An odd number of arguments have been passed (argv[0] is the program name),
|
||||
# so that after accounting for "--param VALUE" pairs, there is one left over.
|
||||
len(sys.argv) % 2 == 0
|
||||
# The leftover argument is a parameter value rather than a flag (such as "--help").
|
||||
# There is at least one argument (argv[0] is the program name).
|
||||
len(sys.argv) > 1
|
||||
# No model has been explicitly provided.
|
||||
and "--model" not in sys.argv
|
||||
# The last argument is a parameter value rather than a flag (such as "--help").
|
||||
and not sys.argv[-1].startswith("-")
|
||||
):
|
||||
# Assume the last argument is the model.
|
||||
|
||||
Reference in New Issue
Block a user