From 65aa5ef9d01bb03a6716e816c0a445be2e75ec0a Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 19 Mar 2026 16:16:00 -0700 Subject: [PATCH 1/3] client: Dockerfiles: remote: archlinux: add `bash-completion` package to base --- .../remote/docker-finance/finance/Dockerfile.archlinux | 1 + 1 file changed, 1 insertion(+) diff --git a/client/Dockerfiles/remote/docker-finance/finance/Dockerfile.archlinux b/client/Dockerfiles/remote/docker-finance/finance/Dockerfile.archlinux index 2efad71..fda2482 100644 --- a/client/Dockerfiles/remote/docker-finance/finance/Dockerfile.archlinux +++ b/client/Dockerfiles/remote/docker-finance/finance/Dockerfile.archlinux @@ -49,6 +49,7 @@ RUN pacman -Syu \ # Base packages RUN pacman -Syu \ + bash-completion \ bc \ csvkit \ vim \ From 8bc196eff61ee0affda6af976896030a26d293f8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 19 Mar 2026 16:16:54 -0700 Subject: [PATCH 2/3] client: manifest: archlinux: add `bash-completion` package to base --- client/docker-finance.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/client/docker-finance.yaml b/client/docker-finance.yaml index efec6ba..17a83a3 100644 --- a/client/docker-finance.yaml +++ b/client/docker-finance.yaml @@ -36,6 +36,7 @@ container: commands: base: packages: + - "bash-completion" - "bc" - "csvkit" - "vim" From 50245cf03301dcd37eb497c3053b0f0f80940bc8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 19 Mar 2026 16:17:59 -0700 Subject: [PATCH 3/3] client/container: completion: add TODOs for `bash-completion` --- client/src/docker/completion.bash | 22 ++++++++++++++++++++++ container/src/finance/completion.bash | 24 +++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/client/src/docker/completion.bash b/client/src/docker/completion.bash index 95b6965..4b06744 100644 --- a/client/src/docker/completion.bash +++ b/client/src/docker/completion.bash @@ -17,6 +17,28 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# TODO: +# +# - Refactor using `bash-completion` "library" but keep backward compatibility, +# as this would otherwise break the "no more than 3 dependencies" approach to client-side `dfi`. +# +# - When possible, add completion to existing `dfi` arguments that aren't completing +# * e.g., `dfi archlinux/${USER}:default edit type=` -> `dfi archlinux/${USER}:default edit type=rules...` +# +# The not-so-straightforward resolution to this TODO hinges on the fact that +# the default delim for all `dfi` completion is the `=` character (which also exists in `COMP_WORDBREAKS`). +# +# One resolution can be found in: +# +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/completions-core/dd.bash +# +# See also: +# +# - https://github.com/scop/bash-completion/tree/main/completions-core +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1105-L1132 +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1450-L1454 +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L2964-L2968 + # WARNING: because of completion, the docker-finance environment file # is never read. Ergo, for debugging, you'll need to run the following # with log-level 1 or 2: diff --git a/container/src/finance/completion.bash b/container/src/finance/completion.bash index 93634ef..0dcd1fa 100644 --- a/container/src/finance/completion.bash +++ b/container/src/finance/completion.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2024-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2024-2026 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,6 +17,28 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# TODO: +# +# - Refactor using `bash-completion` "library". +# * i.e., remove direct access to COMP* and use what's available, etc. +# +# - Add completion to existing `dfi` arguments that aren't completing. +# * e.g., `dfi profile/subprofile edit type=` -> `dfi profile/subprofile edit type=rules...` +# +# The not-so-straightforward resolution to this TODO hinges on the fact that +# the default delim for all `dfi` completion is the `=` character (which also exists in `COMP_WORDBREAKS`). +# +# One resolution can be found in: +# +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/completions-core/dd.bash +# +# See also: +# +# - https://github.com/scop/bash-completion/tree/main/completions-core +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1105-L1132 +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1450-L1454 +# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L2964-L2968 + # shellcheck disable=SC2154 [ "$DOCKER_FINANCE_DEBUG" == 2 ] && set -xv