Skip to content

Commit 0e18dc9

Browse files
authored
Add cli option to override org config value at runtime (#17932)
* Add cli option to override org config value at runtime * add changelog
1 parent be9ce36 commit 0e18dc9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ddev/changelog.d/17932.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add cli option to override org config value at runtime

ddev/src/ddev/cli/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
@click.option('--marketplace', '-m', is_flag=True, help='Work on `marketplace`.')
3434
@click.option('--agent', '-a', is_flag=True, help='Work on `datadog-agent`.')
3535
@click.option('--here', '-x', is_flag=True, help='Work on the current location.')
36+
@click.option('--org', '-o', default=None, help='Override org config field for this invocation.')
3637
@click.option(
3738
'--color/--no-color',
3839
default=None,
@@ -69,7 +70,9 @@
6970
)
7071
@click.version_option(version=__version__, prog_name='ddev')
7172
@click.pass_context
72-
def ddev(ctx: click.Context, core, extras, marketplace, agent, here, color, interactive, verbose, quiet, config_file):
73+
def ddev(
74+
ctx: click.Context, core, extras, marketplace, agent, here, org, color, interactive, verbose, quiet, config_file
75+
):
7376
"""
7477
\b
7578
_ _
@@ -105,6 +108,8 @@ def ddev(ctx: click.Context, core, extras, marketplace, agent, here, color, inte
105108
app.abort(
106109
f'Unable to create config file located at `{str(app.config_file.path)}`. Please check your permissions.'
107110
)
111+
if org is not None:
112+
app.config.org = org
108113

109114
if not ctx.invoked_subcommand:
110115
app.display_info(ctx.get_help(), highlight=False)

0 commit comments

Comments
 (0)