diff options
| author | Miquel Sabaté <mikisabate@gmail.com> | 2013-07-31 12:57:57 +0200 |
|---|---|---|
| committer | Miquel Sabaté <mikisabate@gmail.com> | 2013-07-31 12:57:57 +0200 |
| commit | 97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1 (patch) | |
| tree | c489e8cfcb5e398ea9779b23dd4c5819239c763e | |
| parent | 50c8973995f196ddb841b587b511b9ba50f50005 (diff) | |
| download | g-97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1.tar.gz g-97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1.zip | |
Added the keys option to the list command
| -rw-r--r-- | g.sh | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,4 +1,3 @@ -#!/bin/bash # # Copyright (C) 2013 Miquel Sabaté Solà <mikisabate@gmail.com> # @@ -102,9 +101,17 @@ g() { ;; list) get_shortcuts - for i in "${!gshortcuts[@]}"; do - echo "$i => ${gshortcuts[$i]}" - done + if [[ "$#" == "2" && "$2" == "--keys" ]]; then + str="" + for i in "${!gshortcuts[@]}"; do + str="$str $i" + done + echo $str + else + for i in "${!gshortcuts[@]}"; do + echo "$i => ${gshortcuts[$i]}" + done + fi ;; *) get_shortcuts |
