aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté <mikisabate@gmail.com>2013-07-31 12:57:57 +0200
committerMiquel Sabaté <mikisabate@gmail.com>2013-07-31 12:57:57 +0200
commit97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1 (patch)
treec489e8cfcb5e398ea9779b23dd4c5819239c763e
parent50c8973995f196ddb841b587b511b9ba50f50005 (diff)
downloadg-97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1.tar.gz
g-97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1.zip
Added the keys option to the list command
-rw-r--r--g.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/g.sh b/g.sh
index 8abfee9..6b83a1b 100644
--- a/g.sh
+++ b/g.sh
@@ -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