t script safety
This commit is contained in:
parent
59f8ab46ea
commit
bf79895ea8
@ -10,7 +10,7 @@ readonly EXIT_SUCCESS=0
|
||||
readonly NOTES_DIR_BASE="${HOME}/.t"
|
||||
readonly NOTES_DIR="${NOTES_DIR_BASE}/${NS:-default}"
|
||||
|
||||
TAB="$(printf '\t')"
|
||||
TAB="$(printf -- '\t')"
|
||||
readonly TAB
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ cmd_help() {
|
||||
|
||||
|
||||
NAMESPACES
|
||||
t namespaces # show namespaces
|
||||
t namespaces # show namespaces
|
||||
NS=work t a fix bug 211 # add note in workspace 'work'
|
||||
NS=work t # show notes in workspace 'work'"
|
||||
}
|
||||
@ -56,7 +56,7 @@ show_notes_with_indexes() {
|
||||
note_lines="..."
|
||||
fi
|
||||
|
||||
printf "[%d]\t%s\t(%s)\n" "${index}" "$(basename "${note}")" "${note_lines}"
|
||||
printf -- '[%d]\t%s\t(%s)\n' "${index}" "$(basename -- "${note}")" "${note_lines}"
|
||||
index="$((index+1))"
|
||||
done
|
||||
|
||||
@ -132,7 +132,7 @@ cmd_show_namespaces() {
|
||||
for ns in $(find "${NOTES_DIR_BASE}/" -mindepth 1 -maxdepth 1 -type d | sort -n)
|
||||
do
|
||||
namespace_notes_count="$(find "${ns}" -type f | wc -l)"
|
||||
printf "%s\t(%s)\n" "$(basename "${ns}")" "${namespace_notes_count}"
|
||||
printf -- '%s\t(%s)\n' "$(basename "${ns}")" "${namespace_notes_count}"
|
||||
done
|
||||
) | prettify
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user