From a461cda2ff2249056dd45e85d0897a1a5a5ccb5d Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Mon, 24 Jun 2024 15:45:13 -0700 Subject: [PATCH] container: bash: lib_edit: add iadd Upstream will still need to add comment/metadata functionality to iadd. --- container/src/finance/lib/internal/lib_edit.bash | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/container/src/finance/lib/internal/lib_edit.bash b/container/src/finance/lib/internal/lib_edit.bash index 619a821..7027a3d 100644 --- a/container/src/finance/lib/internal/lib_edit.bash +++ b/container/src/finance/lib/internal/lib_edit.bash @@ -157,7 +157,7 @@ function lib_edit::__parse_args() read -ra _read <<<"$_arg_type" for _type in "${_read[@]}"; do - if [[ ! "$_type" =~ ^fetch$|^manual$|^meta$|^preprocess$|^rules$|^shell$ ]]; then + if [[ ! "$_type" =~ ^fetch$|^iadd$|^manual$|^meta$|^preprocess$|^rules$|^shell$ ]]; then lib_utils::die_usage "$_usage" fi if [[ ! -z "$_arg_account" ]]; then @@ -209,16 +209,18 @@ function lib_edit::__edit() fetch) $EDITOR "$global_conf_fetch" ;; - manual) + iadd | manual) local _path="${global_child_profile_flow}/import/${global_child_profile}/_manual_/${global_arg_year}" [ ! -d "$_path" ] && mkdir -p "$_path" _path+="/post-import.journal" [ ! -f "$_path" ] && touch "$_path" + # TODO: upstream request to provide comment(N) entries + [[ "$_type" == "iadd" ]] && /usr/bin/hledger-iadd -f "$_path" + # TODO: option for editor type - $EDITOR "$_path" - #/usr/bin/hledger-iadd -f "$_path" # TODO: upstream request to provide comment(N) entries + [[ "$_type" == "manual" ]] && $EDITOR "$_path" ;; meta) # NOTE: