container: bash: lib_edit: add iadd

Upstream will still need to add comment/metadata functionality to iadd.
This commit is contained in:
2024-06-24 15:45:13 -07:00
parent 3c6c9311da
commit a461cda2ff

View File

@@ -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: