commit 9a40e078c44237970cc7cf8815ad90da84e652d4
parent c634c9294b04e4cab8146d5d2f4ce7b92e9382ef
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date: Wed, 9 Nov 2016 20:08:09 +0100
(m) Bikeshed __set-prompt
- 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.
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git 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 ()