Skip to content

Commit

Permalink
rm.zsh
Browse files Browse the repository at this point in the history
Corrections for th rm command
  • Loading branch information
srijanshetty committed May 24, 2015
1 parent fc860bb commit 7fe39b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config.zsh
Expand Up @@ -34,6 +34,8 @@ hash mount &>/dev/null &&
hash rsync &>/dev/null &&
source "$_dwim_transform_dir/rsync.zsh"

source "$_dwim_transform_dir/rm.zsh"

hash ssh &>/dev/null &&
source "$_dwim_transform_dir/ssh.zsh"

Expand Down
14 changes: 14 additions & 0 deletions transform.d/rm.zsh
@@ -0,0 +1,14 @@
## rm -> rm -f (on failure)
_dwim_add_transform '^rm' \
'_dwim_sed "s/^rm /rm -f /"' \
1

## rm -f -> rm -rf (on failure)
_dwim_add_transform '^rm -f' \
'_dwim_sed "s/^rm -f /rm -rf /"' \
1

## rm -rf -> sudo rm -rf (on failure)
_dwim_add_transform '^rm -rf' \
'_dwim_sed "s/^rm -rf /sudo rm -rf /"' \
1

0 comments on commit 7fe39b2

Please sign in to comment.