From 9a40e078c44237970cc7cf8815ad90da84e652d4 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 9 Nov 2016 20:08:09 +0100 Subject: (m) Bikeshed __set-prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - every function should give explicit names to its arguments, so they might as well start with that; - this function's goal is to build PS1, so BUILDING_PS1=t should appear reasonably early to have some symmetry with unset BUILDING_PS1; - PS1 is the main output of this function, so its initialization should appear relatively early as well. … I'm trying to justify shuffling some assignments around in a commit message that no one will ever read. WHAT AM I DOING WITH MY LIFE. --- .bashprompt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.bashprompt b/.bashprompt index 6eb6e3b..1b300ce 100644 --- a/.bashprompt +++ b/.bashprompt @@ -106,10 +106,8 @@ __fontify () __set-prompt () { - BUILDING_PS1=t - local last_status=$1 - + BUILDING_PS1=t PS1='' if [ ${last_status} -ne 0 ] @@ -131,7 +129,7 @@ __set-prompt () PS1+=$(__fontify '\$' dim) PS1+=' ' - BUILDING_PS1= + unset BUILDING_PS1 } __current-column () -- cgit v1.2.3