Browse Source

Cleanup of coding style quoting, docstring and bogus files

Alois Mahdal 8 months ago
parent
commit
c7d862bb3b

+ 0
- 1
dotfiles/bash View File

1
-bashum

+ 16
- 3
dotfiles/config/bashum/colors.bashrc View File

1
 #!/bin/bash
1
 #!/bin/bash
2
+#shellcheck disable=SC1087,SC2034
2
 
3
 
3
 #
4
 #
4
 # Context symbol used in title and prompt
5
 # Context symbol used in title and prompt
5
 #
6
 #
6
 BASHUM_CTXSYM=${BASHUM_CTXSYM:-}
7
 BASHUM_CTXSYM=${BASHUM_CTXSYM:-}
7
 
8
 
8
-# get some fancy colorz
9
+#
10
+# ANSI color codes
11
+#
12
+# Don't use these in prompts or line editing will likely be
13
+# broken.  (Bash/readline will count these character despite
14
+# the fact they don't move the cursor.)  Use BASHUM_PS_COLOR_*
15
+# instead.
16
+#
9
 BASHUM_COLOR_BLACK=$'\033[0;30m'
17
 BASHUM_COLOR_BLACK=$'\033[0;30m'
10
 BASHUM_COLOR_RED=$'\033[0;31m'
18
 BASHUM_COLOR_RED=$'\033[0;31m'
11
 BASHUM_COLOR_GREEN=$'\033[0;32m'
19
 BASHUM_COLOR_GREEN=$'\033[0;32m'
24
 BASHUM_COLOR_LWHITE=$'\033[1;37m'
32
 BASHUM_COLOR_LWHITE=$'\033[1;37m'
25
 BASHUM_COLOR_NORMAL=$'\033[1;0m'
33
 BASHUM_COLOR_NORMAL=$'\033[1;0m'
26
 
34
 
27
-# get some fancy colorz
35
+#
36
+# ANSI color codes
37
+#
38
+# Unlike BASHUM_COLOR_*, these have extra escapes for Bash
39
+# so that they can be used in Bash prompt without breaking
40
+# line editing.
41
+#
28
 BASHUM_PS_COLOR_BLACK=$'\[\033[0;30m\]'
42
 BASHUM_PS_COLOR_BLACK=$'\[\033[0;30m\]'
29
 BASHUM_PS_COLOR_RED=$'\[\033[0;31m\]'
43
 BASHUM_PS_COLOR_RED=$'\[\033[0;31m\]'
30
 BASHUM_PS_COLOR_GREEN=$'\[\033[0;32m\]'
44
 BASHUM_PS_COLOR_GREEN=$'\[\033[0;32m\]'
43
 BASHUM_PS_COLOR_LWHITE=$'\[\033[1;37m\]'
57
 BASHUM_PS_COLOR_LWHITE=$'\[\033[1;37m\]'
44
 BASHUM_PS_COLOR_NORMAL=$'\[\033[1;0m\]'
58
 BASHUM_PS_COLOR_NORMAL=$'\[\033[1;0m\]'
45
 
59
 
46
-#shellcheck disable=SC1087
47
 bashum__colordemo() {
60
 bashum__colordemo() {
48
     local bla=$BASHUM_COLOR_BLACK
61
     local bla=$BASHUM_COLOR_BLACK
49
     local red=$BASHUM_COLOR_RED
62
     local red=$BASHUM_COLOR_RED

+ 1
- 1
dotfiles/config/bashum/head.bashrc View File

13
   "${HOME}/.config/bashum/host/$(hostname -s).bashrc" \
13
   "${HOME}/.config/bashum/host/$(hostname -s).bashrc" \
14
   "${HOME}/.config/bashum/post.bashrc";
14
   "${HOME}/.config/bashum/post.bashrc";
15
 do
15
 do
16
-  test -f "$include" && . "$include";
16
+  test -f "$include" && . "$include"
17
 done
17
 done
18
 true
18
 true

+ 1
- 1
dotfiles/config/bashum/setup View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 put() {
3
 put() {
4
-    echo "$1" >> "$HOME/.bashrc"
4
+    echo "$1" >>"$HOME/.bashrc"
5
 }
5
 }
6
 
6
 
7
 mark="# added by https://gitea.vornet.cz/netvor/mydots"
7
 mark="# added by https://gitea.vornet.cz/netvor/mydots"