diff options
| author | Teddy Wing | 2016-07-21 22:17:46 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-07-21 22:17:46 -0400 |
| commit | 48993ad34d2976f963f05ed9eaeed736b9668004 (patch) | |
| tree | 1ca6ea81ffa141ce04024ed06f9fc662e0cd3353 | |
| parent | 8f564b8615336e15d5ffb01ee0bc8622a32e8031 (diff) | |
| download | qcd-48993ad34d2976f963f05ed9eaeed736b9668004.tar.bz2 | |
qcd: Add "remove" command
Remove a given shortcut from the database.
| -rwxr-xr-x | qcd | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -55,6 +55,14 @@ function change_shortcut () { fi } +function remove_shortcut () { + local shortcut=$1 + + if shortcut_exists $shortcut; then + sed -i.bak -E "/^${shortcut} .+/d" $QCD_DATABASE_FILE + fi +} + function qcd () { if [[ $# < 1 ]]; then print_usage @@ -75,6 +83,7 @@ function qcd () { change_shortcut $shortcut $path ;; -r) + remove_shortcut $shortcut ;; -h|--help) print_usage |
