summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 ()
# Works only for simple cases
cci ()
{
- trap 'unfunction ask' EXIT
-
- ask ()
+ _ask_$0 ()
{
echo -n "Is this ok? [y/n] "
@@ -105,17 +103,17 @@ cci ()
if [[ -n $indexed ]]; then
echo ">> Stuff in index -- only commiting this"
echo "$indexed"
- ask || return 2
+ _ask_$0 || return 2
else
echo ">> Nothing in index -- commiting everything which has changed"
echo "$(config status)"
- ask || return 2
+ _ask_$0 || return 2
config add -u
fi
cstg diff -O --cached
- ask || return 2
+ _ask_$0 || return 2
echo ">> Creating new patch"
cstg new $tok -m "$message"
@@ -176,11 +174,11 @@ menc()
# based on a script by mv
list_cc_flags()
{
- trap 'unfunction Usage' EXIT
+ local funcname=${0##*/}
- Usage ()
+ _Usage_$0 ()
{
- printf '%s\n' "Usage: ${0##*/} c|o [gcc-Flags e.g. -march=native -O2]
+ printf '%s\n' "Usage: $funcname c|o [gcc-Flags e.g. -march=native -O2]
Show which compile|optimization flags are selected when you chose gcc-Flags"
return ${1:-1}
}
@@ -195,7 +193,7 @@ PROG
o)
shift
gcc -c -Q "${@}" -o /dev/null --help=optimizer 2>&1;;
- *) Usage;;
+ *) _Usage_$0;;
esac
}