From 07fa6bbc9caf5b0877aec21e9eaa403c185f2ac6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 1 Nov 2025 22:22:56 -1000 Subject: [PATCH] ;doc:argument files: edits --- hledger/hledger.m4.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 7413d71f4..3b8ac4ebb 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -520,16 +520,32 @@ See [Special characters](#special-characters). ## Argument files You can save a set of command line options and arguments in a file, -and then reuse them by writing `@FILENAME` as a command line argument. -Eg: `hledger bal @cash.args`. +and then use them by writing `@FILE.args` as a hledger command argument. +The `.args` file extension is conventional, but not required. +In an argument file, -The syntax in an argument file is quite restrictive: - -- Each line should contain just one option or argument. +- Each line can contain one argument, flag, or option. +- Blank lines or lines beginning with `#` are ignored. - An option's flag and value should be joined by `=`. -- An option value or an argument may contain spaces. -- But don't use single or double quotes. -- And generally use one less level of quoting/escaping than at the command line. +- An option value or an argument may contain spaces. Don't use single or double quotes. +- And generally, use one less level of quoting/escaping than at the command line. + Eg `cur:\$`, not `cur:\\$` as on the command line. + +For example: +```text +# cash.args + +assets:cash +assets:charles schwab:sweep +cur:\$ +-c=$1. +``` +```cli +$ hledger bal @cash.args +``` + + + ## Config files