1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-20 09:39:01 +00:00

+ command with confirm

This commit is contained in:
Kyle 2015-04-22 22:21:17 +08:00
parent 8376fed459
commit d708ce984a

View File

@ -112,6 +112,8 @@ And add to `.bashrc` or `.zshrc` or `.bash_profile`(for OSX):
alias fuck='$(thefuck $(fc -ln -1))'
# You can use whatever you want as an alias, like for mondays:
alias FUCK='fuck'
# Confirm before execute if you have scruple:
alias shit='cmd=$(thefuck $(fc -ln -1)); if [[ "$cmd" =~ "^echo .+" ]]; then eval $cmd; else printf "Sure? press Enter to continue..."; read -n 1 confirm; if [[ "$confirm" -eq "" ]]; then echo ''; eval $cmd; fi; fi'
```
Or in `config.fish`: