summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 10:47:14 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 10:47:15 +0100
commitd290ff25fb277091e61bd0aa55c0b644b64b5f20 (patch)
tree2b636c9220dd3710cea781e3d2c5cb74df14cf03
parentd72a7d09a53c3c10615337a1306efb050e88eba3 (diff)
downloaddotfiles-d290ff25fb277091e61bd0aa55c0b644b64b5f20.tar.gz
dotfiles-d290ff25fb277091e61bd0aa55c0b644b64b5f20.tar.bz2
dotfiles-d290ff25fb277091e61bd0aa55c0b644b64b5f20.zip
Try to avoid name-clashes
-rw-r--r--.zsh/zshfunctions18
1 files changed, 8 insertions, 10 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions
index 3a10bd4..67186cd 100644
--- a/.zsh/zshfunctions
+++ b/.zsh/zshfunctions
@@ -75,9 +75,7 @@ open_ebuild ()
75# Works only for simple cases 75# Works only for simple cases
76cci () 76cci ()
77{ 77{
78 trap 'unfunction ask' EXIT 78 _ask_$0 ()
79
80 ask ()
81 { 79 {
82 echo -n "Is this ok? [y/n] " 80 echo -n "Is this ok? [y/n] "
83 81
@@ -105,17 +103,17 @@ cci ()
105 if [[ -n $indexed ]]; then 103 if [[ -n $indexed ]]; then
106 echo ">> Stuff in index -- only commiting this" 104 echo ">> Stuff in index -- only commiting this"
107 echo "$indexed" 105 echo "$indexed"
108 ask || return 2 106 _ask_$0 || return 2
109 else 107 else
110 echo ">> Nothing in index -- commiting everything which has changed" 108 echo ">> Nothing in index -- commiting everything which has changed"
111 echo "$(config status)" 109 echo "$(config status)"
112 110
113 ask || return 2 111 _ask_$0 || return 2
114 config add -u 112 config add -u
115 fi 113 fi
116 114
117 cstg diff -O --cached 115 cstg diff -O --cached
118 ask || return 2 116 _ask_$0 || return 2
119 117
120 echo ">> Creating new patch" 118 echo ">> Creating new patch"
121 cstg new $tok -m "$message" 119 cstg new $tok -m "$message"
@@ -176,11 +174,11 @@ menc()
176# based on a script by mv 174# based on a script by mv
177list_cc_flags() 175list_cc_flags()
178{ 176{
179 trap 'unfunction Usage' EXIT 177 local funcname=${0##*/}
180 178
181 Usage () 179 _Usage_$0 ()
182 { 180 {
183 printf '%s\n' "Usage: ${0##*/} c|o [gcc-Flags e.g. -march=native -O2] 181 printf '%s\n' "Usage: $funcname c|o [gcc-Flags e.g. -march=native -O2]
184 Show which compile|optimization flags are selected when you chose gcc-Flags" 182 Show which compile|optimization flags are selected when you chose gcc-Flags"
185 return ${1:-1} 183 return ${1:-1}
186 } 184 }
@@ -195,7 +193,7 @@ PROG
195 o) 193 o)
196 shift 194 shift
197 gcc -c -Q "${@}" -o /dev/null --help=optimizer 2>&1;; 195 gcc -c -Q "${@}" -o /dev/null --help=optimizer 2>&1;;
198 *) Usage;; 196 *) _Usage_$0;;
199 esac 197 esac
200} 198}
201 199