Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file support #2206

Merged
merged 28 commits into from
Jun 26, 2024
Merged

Config file support #2206

merged 28 commits into from
Jun 26, 2024

Conversation

simonmichael
Copy link
Owner

@simonmichael simonmichael commented Jun 25, 2024

A new config file system, to replace argument files and ad hoc shell aliases, as discussed at #1013.
Commits, oldest first:

f4c0d0b * feat: cli: basic config file support for hledger
cfd7e80 * dev: cli: refactor/clarify main procedure and command line processing
eeeb3c6 * imp: cli: allow command options to be written before the command also
3c7050f * dev: refactor: move emptyorcommentlinep'; hlint
895dbae * dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse
6add151 * ;cabal: update cabal files
a2ecd7e * feat: config file: add a real parser, support command-specific options
d93d97a * imp: move --debug to help flags, making it more universal
0cc2530 * feat: config file: ignore unsupported general options; refactor
e896ae5 * feat: config file: rename/update sample config
cee57ae * imp: TimedotReader: trace parsing at debug level 9
412a438 * dev: comment parsing tests/refactoring, fix indented timedot comments
2c14e89 * dev: refactor: cli main procedure
ba799c5 * fix: config file: pass only post-cmd and cmd-specific conf opts to addons
b5621e9 * fix: ui, web: accept valueless --debug flag again
485593d * fix: cli: don't let a valueless --debug flag eat the command name
a25f88d * fix: cli: ensureDebugFlagHasVal: fix multiple --debug flags not just one
ee669f4 * imp: config file: don't require -- before addon-specific opts
830a3d8 * imp: config file: also try home and XDG config dirs
a4aeb0a * imp: config file: also try parent dirs
c3e3a5b * imp: config file: --conf, --no-conf/-n, improve debug output
a2ea513 * imp: cli: rename --rules-file to --rules; tweak options help
91892d7 * ;doc: config files
489b6d8 * ;tools: Shake cmddocs: improve help
b218558 * ;doc: update help
3487e1c * doc: update manuals
b8e8a2a * ;doc: config files: edits

Doc: Config files

Example: hledger.conf.sample

And some refactoring of command line parsing code.

General options only, in ./hledger.conf, for now.
It's clearer to write command-specific flags after the command name
argument, but that's no longer required.
(Writing non-builtin, addon-specific flags after -- is still required).

Also, give up on "obey help/doc/version flags even if there's a bad
command/flag", it's too hard to do well.
For brevity, and consistency with --conf.
--rules-file remains supported, as a hidden option.

hledger's main mode now supports the hidden legacy flags,
as the command modes do.
@simonmichael simonmichael merged commit 26978ff into master Jun 26, 2024
2 checks passed
@simonmichael simonmichael deleted the conf branch June 26, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant