diff options
author | Matthew Lemon <y@yulqen.org> | 2024-02-04 20:07:34 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-02-04 20:07:34 +0000 |
commit | e9656a28bdb9c5a5bb5efa07dd5a38aae5398141 (patch) | |
tree | a7c20976acee08ef5c9f73d100735214c4a0d691 /fish2024/functions | |
parent | b5e7ee4db7736292f4637fb0df7f58e6f840f91e (diff) |
Adds _mealplan function
Diffstat (limited to 'fish2024/functions')
-rw-r--r-- | fish2024/functions/_mealplan.fish | 20 | ||||
-rw-r--r-- | fish2024/functions/breakfast.fish | 10 |
2 files changed, 29 insertions, 1 deletions
diff --git a/fish2024/functions/_mealplan.fish b/fish2024/functions/_mealplan.fish new file mode 100644 index 0000000..30c8a20 --- /dev/null +++ b/fish2024/functions/_mealplan.fish @@ -0,0 +1,20 @@ +function _mealplan + #set -l cmd "grep Monday ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md|cut -d: -f3" + if test -z $argv[1] + echo "Usage: mealplan <day> <meal>" + echo " day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday" + echo " meal: b, l, t" + return + end + + set -l day $argv[1] + + if test $argv[2] = "b" + set -f meal "-f2" + else if test $argv[2] = "l" + set -f meal "-f3" + else if test $argv[2] = "t" + set -f meal "-f4" + end + echo (grep -i $day ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md|cut -d: $meal) +end diff --git a/fish2024/functions/breakfast.fish b/fish2024/functions/breakfast.fish index 638e001..6168976 100644 --- a/fish2024/functions/breakfast.fish +++ b/fish2024/functions/breakfast.fish @@ -1,5 +1,13 @@ -function breakfast +function _mealplan --description 'Get the meal plan for a day' + # Uses the file at ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md #set -l cmd "grep Monday ~/Documents/Notes/2.Areas/Health/Breakfast_and_Lunch_Plan_IBD.md|cut -d: -f3" + if test -z $argv[1] + echo "Usage: mealplan <day> <meal>" + echo " day: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday" + echo " meal: b, l, t" + return + end + set -l day $argv[1] if test $argv[2] = "b" |