-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
A warning/confirm field that shows a confirm prompt before proceeding #100
Comments
Hi @ianwalter, This is probably already possible somehow using bash inside a command. I'll keep this open for discussion if this is worth implementing. It would not be hard. |
@andreynering That's a good point. I could use |
@ianwalter Take a look at the silent option, you can prevent a command to be printed. I still consider to accept a patch for this, though. |
Hey @andreynering is this something still being considered? Having this command in a cmds:
- read -p "Display me as a prompt. Continue? (y/n)" And produces this oddity: read: invalid option "-p" If you still think adding a |
@parkerduckworth That should be possible once mvdan/sh#551 is implemented upstream. |
Example prompt implemented with the dialog command in case someone needs a confirmation prompt until this feature is discussed. version: '3'
tasks:
confirm:
desc: "Executes a dangerous command.."
cmds:
- |
dheight=10 \
; dwidth=60 \
; dialog \
--defaultno \
--backtitle "Dangerous Command Title" \
--yesno \
"Do you really want to execute the dangerous command?" \
${dheight} \
${dwidth}
- echo "Executing dangerous command." |
Hello @andreynering , I would like to contribute to the project and improve my Go skills I think it is a good issue to start. Do you mind assigning it to me ? My idea is to implement a function from
|
I know this is kind of necrothreading, but to be fair, the -p flag works for me, look: |
Not really, this still hasn't been implemented and I think it can still add value to Task 😛 A couple of things have changed since this thread was last updated:
Yep,
We now have Also a recent related discussion: #1033. |
I think it would be cool if there was a way to specify a warning before executing commands in which the user may not fully understand the consequences. It could look like:
And then before executing
task reset
it would prompt the user with a confirm prompt that looks like:The text was updated successfully, but these errors were encountered: