t script feature get note content
This commit is contained in:
parent
0cecbd4e43
commit
229fb1c863
@ -49,6 +49,7 @@ cmd_help() {
|
|||||||
T script for fast notes
|
T script for fast notes
|
||||||
|
|
||||||
t - Show notes in format '[INDEX] NOTE NAME (LINES)'
|
t - Show notes in format '[INDEX] NOTE NAME (LINES)'
|
||||||
|
t get (NOTE) - Get note content
|
||||||
t show - Show notes in format '[INDEX] NOTE NAME (LINES)'
|
t show - Show notes in format '[INDEX] NOTE NAME (LINES)'
|
||||||
t (INDEX) - Show note content
|
t (INDEX) - Show note content
|
||||||
t add (X X X) - Add note with name X X X
|
t add (X X X) - Add note with name X X X
|
||||||
@ -188,6 +189,18 @@ cmd_cat_note() {
|
|||||||
exit "${EXIT_SUCCESS}"
|
exit "${EXIT_SUCCESS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_get_note() {
|
||||||
|
note_to_cat="${NOTES_DIR}/${1}"
|
||||||
|
|
||||||
|
if [ ! -f "${note_to_cat}" ]; then
|
||||||
|
die "Note '${1}' not found" 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat "${note_to_cat}"
|
||||||
|
exit "${EXIT_SUCCESS}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cmd_show_namespaces() {
|
cmd_show_namespaces() {
|
||||||
(
|
(
|
||||||
for namespace in $(find "${NOTES_DIR_BASE}/" -mindepth 1 -maxdepth 1 -type d | sort -n)
|
for namespace in $(find "${NOTES_DIR_BASE}/" -mindepth 1 -maxdepth 1 -type d | sort -n)
|
||||||
@ -226,6 +239,7 @@ case "${1}" in
|
|||||||
a|add) shift; cmd_add_note "$@" ;;
|
a|add) shift; cmd_add_note "$@" ;;
|
||||||
d|done|delete) shift; cmd_delete_note "$@" ;;
|
d|done|delete) shift; cmd_delete_note "$@" ;;
|
||||||
e|edit) shift; cmd_edit_note "$@" ;;
|
e|edit) shift; cmd_edit_note "$@" ;;
|
||||||
|
get) shift; cmd_get_note "$@" ;;
|
||||||
--help) shift; cmd_help ;;
|
--help) shift; cmd_help ;;
|
||||||
|
|
||||||
*) cmd_cat_note "$@" ;;
|
*) cmd_cat_note "$@" ;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user