dylanjcastillo / shell-genie

Your wishes are my commands
MIT License
478 stars 36 forks source link

leighklotz: add --execute / --no-execute to ask #17

Open leighklotz opened 10 months ago

leighklotz commented 10 months ago

Example usage:

$ shell-genie ask --execute "echo test"
Command: echo test
test
$ shell-genie ask --explain "echo test"
Command: echo "test"
Description: The "echo" command is used to display a line of text on the terminal. In this case, the command "echo test" will simply print the word "test" on the terminal. The double quotes around the word "test" are optional in this case, as there are no special characters or spaces that need to be preserved. This command should work on Ubuntu 22.04.3 LTS using the bash shell. Do you want to run the command? [y/n]: n
$ shell-genie ask --no-execute --explain "echo test" Command: echo "test"
Description: The "echo" command is used to display a line of text on the terminal. In this case, the command "echo test" will simply print the word "test" on the terminal. The double quotes around the word "test" are optional in this case, as there are no special characters or spaces that need to be preserved. This command should work on Ubuntu 22.04.3 LTS using the bash shell. $ shell-genie ask --no-execute "echo test"
Command: echo test
$ shell-genie ask "echo test"
Command: echo test
Do you want to run the command? [y/n]: n
$
dylanjcastillo commented 10 months ago

Hi @leighklotz,

This is a really good idea. Thanks for adding it.

Would you mind updating the readme to explain how it works?

leighklotz commented 10 months ago

@dylanjcastillo thanks for the kind words. I added doc with minimal disturbance of existing README structure.