From 9435a6869567b5bf206855c2ddd24b39000543ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey?= Date: Wed, 26 Apr 2017 18:46:24 +0200 Subject: [PATCH] xterm.plugin.bash: reformat to follow bash-it code style --- plugins/available/xterm.plugin.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/available/xterm.plugin.bash b/plugins/available/xterm.plugin.bash index e4934a66..db8594a1 100644 --- a/plugins/available/xterm.plugin.bash +++ b/plugins/available/xterm.plugin.bash @@ -2,12 +2,12 @@ cite about-plugin about-plugin 'automatically set your xterm title with host and location info' -short_dirname () { - local dir_name=`dirs -0` - [ "$SHORT_TERM_LINE" = true ] && [ ${#dir_name} -gt 8 ] && echo ${dir_name##*/} || echo $dir_name +_short-dirname () { + local dir_name=`dirs -0` + [ "$SHORT_TERM_LINE" = true ] && [ ${#dir_name} -gt 8 ] && echo ${dir_name##*/} || echo $dir_name } -short_command () { +_short-command () { local input_command="$@" [ "$SHORT_TERM_LINE" = true ] && [ ${#input_command} -gt 8 ] && echo ${input_command%% *} || echo $input_command } @@ -18,11 +18,11 @@ set_xterm_title () { } precmd () { - set_xterm_title "${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}} `short_dirname` $PROMPTCHAR" + set_xterm_title "${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}} `_short-dirname` $PROMPTCHAR" } preexec () { - set_xterm_title "$(short_command $1) {`short_dirname`} (${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}})" + set_xterm_title "`_short-command $1` {`_short-dirname`} (${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}})" } case "$TERM" in