diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-03 18:01:52 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-03 18:01:52 +0200 |
| commit | cab0885735bc48deb52553baac2701ae86dc3749 (patch) | |
| tree | e6a2dc9ebb3af0083395b6eb02686004f1ab82de | |
| parent | 8c0d2712445f2f175fbfddfde29a783af6530af9 (diff) | |
| download | firefly-cli-cab0885735bc48deb52553baac2701ae86dc3749.tar.gz firefly-cli-cab0885735bc48deb52553baac2701ae86dc3749.zip | |
build(completion): budget group and auto-budget enum values
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rw-r--r-- | completions/firefly.bash | 11 | ||||
| -rw-r--r-- | scripts/gen_completion.py | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/completions/firefly.bash b/completions/firefly.bash index e9dbe0b..06df14e 100644 --- a/completions/firefly.bash +++ b/completions/firefly.bash @@ -16,7 +16,7 @@ _firefly() { } local global_opts="--human --url --token -h --help" - local groups="auth account category tag tx" + local groups="auth account category tag tx budget" # Find the group and leaf among the words (skip the program name at 0). local group="" leaf="" i @@ -40,10 +40,14 @@ _firefly() { "account balance") leaf_opts="--at";; "account create") leaf_opts="--currency --if-not-exists --opening-balance --type";; "account list") leaf_opts="--type";; - "tx add") leaf_opts="--category --date --desc --dry-run --from --from-id --skip-dupes --tags --to --to-id --type";; + "tx add") leaf_opts="--budget --category --date --desc --dry-run --from --from-id --skip-dupes --tags --to --to-id --type";; "tx delete") leaf_opts="--yes";; "tx edit") leaf_opts="--amount --category --date --desc --from --tags --to --type";; "tx list") leaf_opts="--account --all --flat --limit --since --until";; + "budget create") leaf_opts="--active --auto-budget-amount --auto-budget-period --auto-budget-type --currency --inactive";; + "budget delete") leaf_opts="--yes";; + "budget limit-set") leaf_opts="--amount --currency --end --start";; + "budget list") leaf_opts="--end --start";; esac # Leaves per group. @@ -54,6 +58,7 @@ _firefly() { category) leaves="list";; tag) leaves="list";; tx) leaves="add delete edit get list search";; + budget) leaves="create delete disable enable limit-list limit-set list";; esac # Flag values: when the previous word is a flag with a fixed value set for @@ -62,6 +67,8 @@ _firefly() { case "$group $leaf $prev" in "account create --type") vals="asset expense revenue";; "account list --type") vals="asset expense revenue liability";; + "budget create --auto-budget-period")vals="daily weekly monthly quarterly half_year yearly";; + "budget create --auto-budget-type")vals="reset rollover adjusted none";; "tx add --type") vals="withdrawal deposit transfer";; "tx edit --type") vals="withdrawal deposit transfer";; esac diff --git a/scripts/gen_completion.py b/scripts/gen_completion.py index cee7d8e..b749f08 100644 --- a/scripts/gen_completion.py +++ b/scripts/gen_completion.py @@ -19,7 +19,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from firefly_cli import registry import firefly_cli.commands # noqa: F401 triggers registration -GROUP_ORDER = ["auth", "account", "category", "tag", "tx"] +GROUP_ORDER = ["auth", "account", "category", "tag", "tx", "budget"] # Static value suggestions for flags whose choices are a fixed enum, keyed on # "<group leaf>" then flag. Account/transaction types are fixed in Firefly, so @@ -29,6 +29,10 @@ FLAG_VALUES = { "account create": {"--type": "asset expense revenue"}, "tx add": {"--type": "withdrawal deposit transfer"}, "tx edit": {"--type": "withdrawal deposit transfer"}, + "budget create": { + "--auto-budget-type": "reset rollover adjusted none", + "--auto-budget-period": "daily weekly monthly quarterly half_year yearly", + }, } |
