浏览代码

Cleanup of coding style quoting, docstring and bogus files

Alois Mahdal 8 个月前
父节点
当前提交
c7d862bb3b
共有 4 个文件被更改,包括 18 次插入6 次删除
  1. 0
    1
      dotfiles/bash
  2. 16
    3
      dotfiles/config/bashum/colors.bashrc
  3. 1
    1
      dotfiles/config/bashum/head.bashrc
  4. 1
    1
      dotfiles/config/bashum/setup

+ 0
- 1
dotfiles/bash 查看文件

@@ -1 +0,0 @@
1
-bashum

+ 16
- 3
dotfiles/config/bashum/colors.bashrc 查看文件

@@ -1,11 +1,19 @@
1 1
 #!/bin/bash
2
+#shellcheck disable=SC1087,SC2034
2 3
 
3 4
 #
4 5
 # Context symbol used in title and prompt
5 6
 #
6 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 17
 BASHUM_COLOR_BLACK=$'\033[0;30m'
10 18
 BASHUM_COLOR_RED=$'\033[0;31m'
11 19
 BASHUM_COLOR_GREEN=$'\033[0;32m'
@@ -24,7 +32,13 @@ BASHUM_COLOR_LCYAN=$'\033[1;36m'
24 32
 BASHUM_COLOR_LWHITE=$'\033[1;37m'
25 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 42
 BASHUM_PS_COLOR_BLACK=$'\[\033[0;30m\]'
29 43
 BASHUM_PS_COLOR_RED=$'\[\033[0;31m\]'
30 44
 BASHUM_PS_COLOR_GREEN=$'\[\033[0;32m\]'
@@ -43,7 +57,6 @@ BASHUM_PS_COLOR_LCYAN=$'\[\033[1;36m\]'
43 57
 BASHUM_PS_COLOR_LWHITE=$'\[\033[1;37m\]'
44 58
 BASHUM_PS_COLOR_NORMAL=$'\[\033[1;0m\]'
45 59
 
46
-#shellcheck disable=SC1087
47 60
 bashum__colordemo() {
48 61
     local bla=$BASHUM_COLOR_BLACK
49 62
     local red=$BASHUM_COLOR_RED

+ 1
- 1
dotfiles/config/bashum/head.bashrc 查看文件

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

+ 1
- 1
dotfiles/config/bashum/setup 查看文件

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