client: docker-finance.d: subscript: remove base cmd

The recently added base command variable would break on multi-profile
systems because, when superscript first sources, this global variable
would be set.

Unsetting/resetting the variable will not be a fix so, revert to the
noisy but dynamic per-alias-generated solution instead.
This commit is contained in:
2024-09-30 16:17:28 -07:00
parent fc93612cc6
commit 750265d4b6

View File

@@ -25,9 +25,6 @@
[ -z "$DOCKER_FINANCE_CONTAINER_CMD" ] && echo "DOCKER_FINANCE_CONTAINER_CMD not set, check installation" >&2 [ -z "$DOCKER_FINANCE_CONTAINER_CMD" ] && echo "DOCKER_FINANCE_CONTAINER_CMD not set, check installation" >&2
# See `help` for all available commands and usage
dfi_base_cmd='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@'
# #
# Notes: # Notes:
# #
@@ -41,38 +38,38 @@ dfi_base_cmd='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FIN
# you'd otherwise apply to all of the subprofile's hledger commands. # you'd otherwise apply to all of the subprofile's hledger commands.
# #
alias @DOCKER_FINANCE_SUBPROFILE@_bal='$dfi_base_cmd hledger bal \ alias @DOCKER_FINANCE_SUBPROFILE@_bal='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger bal \
assets liabilities \ assets liabilities \
' '
## Example: the previous command but with a prepended parent profile "namespace" ## Example: the previous command but with a prepended parent profile "namespace"
#alias @DOCKER_FINANCE_PROFILE@_@DOCKER_FINANCE_SUBPROFILE@_bal='$dfi_base_cmd hledger bal \ #alias @DOCKER_FINANCE_PROFILE@_@DOCKER_FINANCE_SUBPROFILE@_bal='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger bal \
# assets liabilities \ # assets liabilities \
#' #'
## Example: fetch all prices for default (current) year ## Example: fetch all prices for default (current) year
#alias @DOCKER_FINANCE_SUBPROFILE@_prices='$dfi_base_cmd fetch all=price' #alias @DOCKER_FINANCE_SUBPROFILE@_prices='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ fetch all=price'
## Example: print tagged income on all accounts in CSV tax format for default (current) year ## Example: print tagged income on all accounts in CSV tax format for default (current) year
#alias @DOCKER_FINANCE_SUBPROFILE@_income_tax='$dfi_base_cmd taxes all=account tag=income write=off' #alias @DOCKER_FINANCE_SUBPROFILE@_income_tax='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ taxes all=account tag=income write=off'
## Example: write income statements and balance sheets, quarterly & monthly for default (current) year ## Example: write income statements and balance sheets, quarterly & monthly for default (current) year
#alias @DOCKER_FINANCE_SUBPROFILE@_qm_reports='$dfi_base_cmd reports type=is,bs interval=quarterly,monthly' #alias @DOCKER_FINANCE_SUBPROFILE@_qm_reports='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ reports type=is,bs interval=quarterly,monthly'
## Examples: uncomment and customize, as needed ## Examples: uncomment and customize, as needed
#alias @DOCKER_FINANCE_SUBPROFILE@_all='$dfi_base_cmd all' #alias @DOCKER_FINANCE_SUBPROFILE@_all='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ all'
#alias @DOCKER_FINANCE_SUBPROFILE@_edit='$dfi_base_cmd edit' #alias @DOCKER_FINANCE_SUBPROFILE@_edit='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ edit'
#alias @DOCKER_FINANCE_SUBPROFILE@_fetch='$dfi_base_cmd fetch' #alias @DOCKER_FINANCE_SUBPROFILE@_fetch='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ fetch'
#alias @DOCKER_FINANCE_SUBPROFILE@_hledger='$dfi_base_cmd hledger' #alias @DOCKER_FINANCE_SUBPROFILE@_hledger='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger'
#alias @DOCKER_FINANCE_SUBPROFILE@_import='$dfi_base_cmd import' #alias @DOCKER_FINANCE_SUBPROFILE@_import='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ import'
#alias @DOCKER_FINANCE_SUBPROFILE@_meta='$dfi_base_cmd meta' #alias @DOCKER_FINANCE_SUBPROFILE@_meta='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ meta'
#alias @DOCKER_FINANCE_SUBPROFILE@_plugins='$dfi_base_cmd plugins' #alias @DOCKER_FINANCE_SUBPROFILE@_plugins='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ plugins'
#alias @DOCKER_FINANCE_SUBPROFILE@_reports='$dfi_base_cmd reports' #alias @DOCKER_FINANCE_SUBPROFILE@_reports='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ reports'
#alias @DOCKER_FINANCE_SUBPROFILE@_root='$dfi_base_cmd root' #alias @DOCKER_FINANCE_SUBPROFILE@_root='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ root'
#alias @DOCKER_FINANCE_SUBPROFILE@_taxes='$dfi_base_cmd taxes' #alias @DOCKER_FINANCE_SUBPROFILE@_taxes='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ taxes'
#alias @DOCKER_FINANCE_SUBPROFILE@_times='$dfi_base_cmd times' #alias @DOCKER_FINANCE_SUBPROFILE@_times='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ times'
#alias @DOCKER_FINANCE_SUBPROFILE@_ui='$dfi_base_cmd hledger-ui' #alias @DOCKER_FINANCE_SUBPROFILE@_ui='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger-ui'
#alias @DOCKER_FINANCE_SUBPROFILE@_vui='$dfi_base_cmd hledger-vui' #alias @DOCKER_FINANCE_SUBPROFILE@_vui='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger-vui'
#alias @DOCKER_FINANCE_SUBPROFILE@_web='$dfi_base_cmd hledger-web' #alias @DOCKER_FINANCE_SUBPROFILE@_web='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ hledger-web'
# vim: syn=bash sw=2 sts=2 si ai et # vim: syn=bash sw=2 sts=2 si ai et