From 589221ef0912789af716b250dbbaa0284992f8ed Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 23 Apr 2025 01:00:06 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-23 01:00:06 --- .config/fish/functions/jrnl.fish | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.config/fish/functions/jrnl.fish b/.config/fish/functions/jrnl.fish index 55aa6810..7a1b4d35 100644 --- a/.config/fish/functions/jrnl.fish +++ b/.config/fish/functions/jrnl.fish @@ -1,5 +1,30 @@ function jrnl --description 'Lightweight journaling tool' argparse h/help d/dir=? -- $argv + if set -q _flag_h + echo jrnl: a lightweight journaling tool + echo + echo Call jrnl without options to get started. + echo + echo Usage: + echo \tOpen today\'s entry: + echo \t\> jrnl + echo \tSet the journal directory "(~/jrnl)" by default: + echo \tWith environment variable \'jrnl_directory\': + echo \t\> set -Ug jrnl_directory path/to/journal + echo \tWith command option: + echo \t\> jrnl -d=path + echo \t\> jrnl --dir=path + echo \tShow this help menu: + echo \t\> jrnl -h + echo \t\> jrnl --help + echo Author: + echo \tDaniel Fichtinger '' + echo License: + echo \tMIT '(c)' Daniel Fichtinger 2025 + return 0 + + end + set -f jdir ~/jrnl if set -ql _flag_dir[1] set jdir _flag_dir[1] @@ -13,7 +38,7 @@ function jrnl --description 'Lightweight journaling tool' # get the date set today (date +'%Y-%m-%d') - set entry "$jrnl/$today.md" + set entry "$jdir/$today.md" # check if journal entry exists if not test -f $entry set -l template \ @@ -35,7 +60,7 @@ I'm grateful for ... _One sentence to reflect on today:_ -- reflection. +- reflection ## Learned