diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2018-10-19 18:48:38 +0100 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2018-11-20 11:43:49 +0000 |
commit | 7ae3a3d2433f0909a6c4d43655b8fff95fb8c318 (patch) | |
tree | 4ae64f1775a4f82de378bb4d87e85ac025a4cea4 /buildstream/_frontend | |
parent | 27ca65931d3cf6cf897b623f21ba2363f3c54029 (diff) | |
download | buildstream-7ae3a3d2433f0909a6c4d43655b8fff95fb8c318.tar.gz |
Add prompt.workspace-... options
Provide options in project.conf to disable the 'Are you sure ...'
prompts when making destructive changes:
- Add prompt.really-workspace-close-remove-dir
- Add prompt.really-workspace-reset-hard
Add a NEWS item for these.
Diffstat (limited to 'buildstream/_frontend')
-rw-r--r-- | buildstream/_frontend/cli.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index 725dc8c1d..92abd96e8 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -772,7 +772,7 @@ def workspace_close(app, remove_dir, all_, elements): if nonexisting: raise AppError("Workspace does not exist", detail="\n".join(nonexisting)) - if app.interactive and remove_dir: + if app.interactive and remove_dir and app.context.prompt_workspace_close_remove_dir: if not click.confirm('This will remove all your changes, are you sure?'): click.echo('Aborting', err=True) sys.exit(-1) @@ -806,7 +806,7 @@ def workspace_reset(app, soft, track_, all_, elements): if all_ and not app.stream.workspace_exists(): raise AppError("No open workspaces to reset") - if app.interactive and not soft: + if app.interactive and not soft and app.context.prompt_workspace_reset_hard: if not click.confirm('This will remove all your changes, are you sure?'): click.echo('Aborting', err=True) sys.exit(-1) |