summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2016-11-09 20:08:09 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2016-11-09 20:08:09 +0100
commit9a40e078c44237970cc7cf8815ad90da84e652d4 (patch)
tree38d3c1932d5b8c29b82cdd3c285505f590026bf1
parentc634c9294b04e4cab8146d5d2f4ce7b92e9382ef (diff)
downloaddotfiles-9a40e078c44237970cc7cf8815ad90da84e652d4.tar.xz
(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.
-rw-r--r--.bashprompt6
1 files 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 ()