From 97122b6f5f29c30cc8c7c30ea3c0790d55f9f7c1 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Date: Wed, 31 Jul 2013 12:57:57 +0200 Subject: Added the keys option to the list command --- g.sh | 15 +++++++++++---- 1 file 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à # @@ -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 -- cgit v1.2.3