container: remove ledger in place of hledger
As said before; `lib_ledger` was meant to be a general abstraction to any underlying CLI ledger. But, between C++ `ledger` and Ledger Hardware Wallet, this abstraction has become too confusing and counterproductive. Since `hledger` will be the underlying implementation for the forseeable future, all doubt should now be removed.
This commit is contained in:
@@ -28,38 +28,38 @@ source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_utils.bash
|
||||
# Facade
|
||||
#
|
||||
|
||||
function lib_ledger::ledger-import()
|
||||
function lib_hledger::hledger-import()
|
||||
{
|
||||
lib_ledger::__ledger "$@"
|
||||
lib_ledger::__ledger-import "$@"
|
||||
lib_hledger::__hledger "$@"
|
||||
lib_hledger::__hledger-import "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_ledger::ledger-cli()
|
||||
function lib_hledger::hledger-cli()
|
||||
{
|
||||
lib_ledger::__ledger "$@"
|
||||
lib_ledger::__ledger-cli "$@"
|
||||
lib_hledger::__hledger "$@"
|
||||
lib_hledger::__hledger-cli "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_ledger::ledger-ui()
|
||||
function lib_hledger::hledger-ui()
|
||||
{
|
||||
lib_ledger::__ledger "$@"
|
||||
lib_ledger::__ledger-ui "$@"
|
||||
lib_hledger::__hledger "$@"
|
||||
lib_hledger::__hledger-ui "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_ledger::ledger-vui()
|
||||
function lib_hledger::hledger-vui()
|
||||
{
|
||||
lib_ledger::__ledger "$@"
|
||||
lib_ledger::__ledger-vui "$@"
|
||||
lib_hledger::__hledger "$@"
|
||||
lib_hledger::__hledger-vui "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_ledger::ledger-web()
|
||||
function lib_hledger::hledger-web()
|
||||
{
|
||||
lib_ledger::__ledger "$@"
|
||||
lib_ledger::__ledger-web "$@"
|
||||
lib_hledger::__hledger "$@"
|
||||
lib_hledger::__hledger-web "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ function lib_ledger::ledger-web()
|
||||
#
|
||||
|
||||
# Constructor
|
||||
function lib_ledger::__ledger()
|
||||
function lib_hledger::__hledger()
|
||||
{
|
||||
# Base arguments to hledger before end-user added
|
||||
[ -z "$global_child_profile_journal" ] && lib_utils::die_fatal
|
||||
@@ -97,7 +97,7 @@ function lib_ledger::__ledger()
|
||||
lib_utils::print_debug "${global_base_args[*]}" "$@"
|
||||
}
|
||||
|
||||
function lib_ledger::__parse_ledger-import()
|
||||
function lib_hledger::__parse_hledger-import()
|
||||
{
|
||||
[ -z "$global_usage" ] && lib_utils::die_fatal
|
||||
[ -z "$global_arg_delim_1" ] && lib_utils::die_fatal
|
||||
@@ -157,30 +157,30 @@ function lib_ledger::__parse_ledger-import()
|
||||
fi
|
||||
}
|
||||
|
||||
function lib_ledger::__ledger-import()
|
||||
function lib_hledger::__hledger-import()
|
||||
{
|
||||
lib_ledger::__parse_ledger-import "$@"
|
||||
lib_hledger::__parse_hledger-import "$@"
|
||||
|
||||
time hledger-flow import \
|
||||
"$(dirname $global_child_profile_journal)" \
|
||||
--start-year "$global_arg_year"
|
||||
}
|
||||
|
||||
function lib_ledger::__ledger-cli()
|
||||
function lib_hledger::__hledger-cli()
|
||||
{
|
||||
[ -z "${global_base_args[*]}" ] && lib_utils::die_fatal
|
||||
|
||||
hledger "${global_base_args[@]}" "$@"
|
||||
}
|
||||
|
||||
function lib_ledger::__ledger-ui()
|
||||
function lib_hledger::__hledger-ui()
|
||||
{
|
||||
[ -z "${global_base_args[*]}" ] && lib_utils::die_fatal
|
||||
|
||||
hledger-ui "${global_base_args[@]}" "$@"
|
||||
}
|
||||
|
||||
function lib_ledger::__ledger-vui()
|
||||
function lib_hledger::__hledger-vui()
|
||||
{
|
||||
[ -z "${global_base_args[*]}" ] && lib_utils::die_fatal
|
||||
|
||||
@@ -188,7 +188,7 @@ function lib_ledger::__ledger-vui()
|
||||
| visidata --motd-url file:///dev/null --filetype csv
|
||||
}
|
||||
|
||||
function lib_ledger::__ledger-web()
|
||||
function lib_hledger::__hledger-web()
|
||||
{
|
||||
[ -z "${global_base_args[*]}" ] && lib_utils::die_fatal
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ function lib_finance::finance()
|
||||
# Implementation "libraries" (requires previously set globals)
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_edit.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_fetch.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_ledger.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_hledger.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_meta.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_plugins.bash" || exit 1
|
||||
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_reports.bash" || exit 1
|
||||
@@ -173,31 +173,31 @@ function lib_finance::fetch()
|
||||
|
||||
function lib_finance::import()
|
||||
{
|
||||
lib_ledger::ledger-import "$@"
|
||||
lib_hledger::hledger-import "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_finance::ledger()
|
||||
function lib_finance::hledger()
|
||||
{
|
||||
lib_ledger::ledger-cli "$@"
|
||||
lib_hledger::hledger-cli "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_finance::ledger-ui()
|
||||
function lib_finance::hledger-ui()
|
||||
{
|
||||
lib_ledger::ledger-ui "$@"
|
||||
lib_hledger::hledger-ui "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_finance::ledger-vui()
|
||||
function lib_finance::hledger-vui()
|
||||
{
|
||||
lib_ledger::ledger-vui "$@"
|
||||
lib_hledger::hledger-vui "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
function lib_finance::ledger-web()
|
||||
function lib_finance::hledger-web()
|
||||
{
|
||||
lib_ledger::ledger-web "$@"
|
||||
lib_hledger::hledger-web "$@"
|
||||
lib_utils::catch $?
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user