Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept --no-echo to turn off run.echo #1000

Open
zed opened this issue Jul 15, 2024 · 0 comments
Open

Accept --no-echo to turn off run.echo #1000

zed opened this issue Jul 15, 2024 · 0 comments

Comments

@zed
Copy link

zed commented Jul 15, 2024

It may be useful to override run.echo parameter if it is set already in a config file/environment variable.

Consider tasks.py:

from invoke import task

@task
def print_echo_param(c):
    c.run(f"echo '{c.config.run.echo=}'")

Then:

$ inv print-echo-param
c.config.run.echo=False

$ inv --echo print-echo-param
echo 'c.config.run.echo=True'
c.config.run.echo=True

If there is export INVOKE_RUN_ECHO=1 then:

$ inv print-echo-param
echo 'c.config.run.echo=True'
c.config.run.echo=True

$ INVOKE_RUN_ECHO=0 inv print-echo-param
c.config.run.echo=False

It would be nice to provide --no-echo instead of INVOKE_RUN_ECHO=0 here.

The current version doesn't recognize --no-echo parameter:

inv --no-echo print-echo-param
No idea what '--no-echo' is!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant