From a47eb6b44a006f8312b7fdfe4d47b9bf818939a0 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Sat, 3 Dec 2022 11:20:04 +0100 Subject: [PATCH] Make configuration files optional --- docs/userguide/deployment.rst | 6 +++--- src/asphalt/core/cli.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/userguide/deployment.rst b/docs/userguide/deployment.rst index 7f9fd45..893ae7b 100644 --- a/docs/userguide/deployment.rst +++ b/docs/userguide/deployment.rst @@ -17,15 +17,15 @@ Running the launcher is very straightfoward: .. code-block:: bash - asphalt run yourconfig.yaml [your-overrides.yml...] [--set path.to.key=val] + asphalt run [yourconfig.yaml your-overrides.yml...] [--set path.to.key=val] Or alternatively: - python -m asphalt run yourconfig.yaml [your-overrides.yml...] [--set path.to.key=val] + python -m asphalt [run yourconfig.yaml your-overrides.yml...] [--set path.to.key=val] What this will do is: -#. read all the given configuration files, starting from ``yourconfig.yaml`` +#. read all the given configuration files, if any, starting from ``yourconfig.yaml`` #. read the command line configuration options passed with ``--set``, if any #. merge the configuration files' contents and the command line configuration options into a single configuration dictionary using :func:`~asphalt.core.utils.merge_config`. diff --git a/src/asphalt/core/cli.py b/src/asphalt/core/cli.py index b1823e5..0c0203c 100644 --- a/src/asphalt/core/cli.py +++ b/src/asphalt/core/cli.py @@ -34,8 +34,8 @@ def main() -> None: pass # pragma: no cover -@main.command(help="Read one or more configuration files and start the application.") -@click.argument("configfile", type=click.File(), nargs=-1, required=True) +@main.command(help="Read configuration files, pass configuration options, and start the application.") +@click.argument("configfile", type=click.File(), nargs=-1) @click.option( "--unsafe", is_flag=True,