container: lib_edit: add hledger conf support
This commit is contained in:
@@ -59,7 +59,7 @@ function lib_edit::__parse_args()
|
|||||||
|
|
||||||
Configuration type:
|
Configuration type:
|
||||||
|
|
||||||
type${global_arg_delim_2}<fetch|manual|meta|shell|rules|preprocess>
|
type${global_arg_delim_2}<fetch|hledger|manual|meta|shell|rules|preprocess>
|
||||||
|
|
||||||
Account:
|
Account:
|
||||||
|
|
||||||
@@ -70,6 +70,9 @@ function lib_edit::__parse_args()
|
|||||||
\e[37;2m# Edit fetch configuration\e[0m
|
\e[37;2m# Edit fetch configuration\e[0m
|
||||||
$ $global_usage type${global_arg_delim_2}fetch
|
$ $global_usage type${global_arg_delim_2}fetch
|
||||||
|
|
||||||
|
\e[37;2m# Edit hledger configuration\e[0m
|
||||||
|
$ $global_usage type${global_arg_delim_2}hledger
|
||||||
|
|
||||||
\e[37;2m# Edit meta and subprofile configurations\e[0m
|
\e[37;2m# Edit meta and subprofile configurations\e[0m
|
||||||
$ $global_usage type${global_arg_delim_2}meta${global_arg_delim_3}shell
|
$ $global_usage type${global_arg_delim_2}meta${global_arg_delim_3}shell
|
||||||
|
|
||||||
@@ -157,7 +160,7 @@ function lib_edit::__parse_args()
|
|||||||
read -ra _read <<<"$_arg_type"
|
read -ra _read <<<"$_arg_type"
|
||||||
|
|
||||||
for _type in "${_read[@]}"; do
|
for _type in "${_read[@]}"; do
|
||||||
if [[ ! "$_type" =~ ^fetch$|^iadd$|^manual$|^meta$|^preprocess$|^rules$|^shell$ ]]; then
|
if [[ ! "$_type" =~ ^fetch$|^hledger$|^iadd$|^manual$|^meta$|^preprocess$|^rules$|^shell$ ]]; then
|
||||||
lib_utils::die_usage "$_usage"
|
lib_utils::die_usage "$_usage"
|
||||||
fi
|
fi
|
||||||
if [[ ! -z "$_arg_account" ]]; then
|
if [[ ! -z "$_arg_account" ]]; then
|
||||||
@@ -201,6 +204,7 @@ function lib_edit::__edit()
|
|||||||
[ -z "$global_child_profile" ] && lib_utils::die_fatal
|
[ -z "$global_child_profile" ] && lib_utils::die_fatal
|
||||||
[ -z "$global_child_profile_flow" ] && lib_utils::die_fatal
|
[ -z "$global_child_profile_flow" ] && lib_utils::die_fatal
|
||||||
[ -z "$global_conf_fetch" ] && lib_utils::die_fatal
|
[ -z "$global_conf_fetch" ] && lib_utils::die_fatal
|
||||||
|
[ -z "$global_conf_hledger" ] && lib_utils::die_fatal
|
||||||
[ -z "$global_conf_meta" ] && lib_utils::die_fatal
|
[ -z "$global_conf_meta" ] && lib_utils::die_fatal
|
||||||
[ -z "$global_conf_shell" ] && lib_utils::die_fatal
|
[ -z "$global_conf_shell" ] && lib_utils::die_fatal
|
||||||
|
|
||||||
@@ -209,6 +213,9 @@ function lib_edit::__edit()
|
|||||||
fetch)
|
fetch)
|
||||||
$EDITOR "$global_conf_fetch"
|
$EDITOR "$global_conf_fetch"
|
||||||
;;
|
;;
|
||||||
|
hledger)
|
||||||
|
$EDITOR "$global_conf_hledger"
|
||||||
|
;;
|
||||||
iadd | manual)
|
iadd | manual)
|
||||||
local _path="${global_child_profile_flow}/import/${global_child_profile}/_manual_/${global_arg_year}"
|
local _path="${global_child_profile_flow}/import/${global_child_profile}/_manual_/${global_arg_year}"
|
||||||
[ ! -d "$_path" ] && mkdir -p "$_path"
|
[ ! -d "$_path" ] && mkdir -p "$_path"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ function lib_finance::finance()
|
|||||||
|
|
||||||
# Globals (configuration)
|
# Globals (configuration)
|
||||||
declare -grx global_conf_fetch="${global_child_profile_flow}/docker-finance.d/fetch/fetch.yaml"
|
declare -grx global_conf_fetch="${global_child_profile_flow}/docker-finance.d/fetch/fetch.yaml"
|
||||||
|
declare -grx global_conf_hledger="${global_child_profile_flow}/docker-finance.d/hledger/hledger.conf"
|
||||||
declare -grx global_conf_meta="${global_child_profile_flow}/docker-finance.d/meta/meta.csv"
|
declare -grx global_conf_meta="${global_child_profile_flow}/docker-finance.d/meta/meta.csv"
|
||||||
declare -grx global_conf_shell="${global_child_profile_flow}/docker-finance.d/shell/subprofile.bash"
|
declare -grx global_conf_shell="${global_child_profile_flow}/docker-finance.d/shell/subprofile.bash"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user