Skip to content

Commit

Permalink
Add cli option to override org config value at runtime (#17932)
Browse files Browse the repository at this point in the history
* Add cli option to override org config value at runtime

* add changelog
  • Loading branch information
iliakur authored Jun 26, 2024
1 parent be9ce36 commit 0e18dc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions ddev/changelog.d/17932.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add cli option to override org config value at runtime
7 changes: 6 additions & 1 deletion ddev/src/ddev/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@click.option('--marketplace', '-m', is_flag=True, help='Work on `marketplace`.')
@click.option('--agent', '-a', is_flag=True, help='Work on `datadog-agent`.')
@click.option('--here', '-x', is_flag=True, help='Work on the current location.')
@click.option('--org', '-o', default=None, help='Override org config field for this invocation.')
@click.option(
'--color/--no-color',
default=None,
Expand Down Expand Up @@ -69,7 +70,9 @@
)
@click.version_option(version=__version__, prog_name='ddev')
@click.pass_context
def ddev(ctx: click.Context, core, extras, marketplace, agent, here, color, interactive, verbose, quiet, config_file):
def ddev(
ctx: click.Context, core, extras, marketplace, agent, here, org, color, interactive, verbose, quiet, config_file
):
"""
\b
_ _
Expand Down Expand Up @@ -105,6 +108,8 @@ def ddev(ctx: click.Context, core, extras, marketplace, agent, here, color, inte
app.abort(
f'Unable to create config file located at `{str(app.config_file.path)}`. Please check your permissions.'
)
if org is not None:
app.config.org = org

if not ctx.invoked_subcommand:
app.display_info(ctx.get_help(), highlight=False)
Expand Down

0 comments on commit 0e18dc9

Please sign in to comment.