From 6bfbecf662be522d60528bc1dc366757b1bd9c29 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 20 Jun 2020 17:12:30 -0700 Subject: [PATCH] journal: doc: document recursive wildcards --- hledger-lib/hledger_journal.m4.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hledger-lib/hledger_journal.m4.md b/hledger-lib/hledger_journal.m4.md index 59626af81..0a9a6b058 100644 --- a/hledger-lib/hledger_journal.m4.md +++ b/hledger-lib/hledger_journal.m4.md @@ -885,11 +885,19 @@ Only journal files can include, and only journal, timeclock or timedot files can If the file path does not begin with a slash, it is relative to the current file's folder. -It may contain [glob patterns] to match multiple files, eg: `include *.journal`. +A tilde means home directory, eg: `include ~/main.journal`. -Or a tilde, meaning home directory: `include ~/main.journal`. +The path may contain [glob patterns] to match multiple files, eg: `include *.journal`. -It may also be prefixed to force a specific file format, overriding the file extension (as described in [hledger.1 -> Input files](hledger.html#input-files)): `include timedot:~/notes/2020*.md`. +There is limited support for recursive wildcards: `**/` (the slash is required) +matches 0 or more subdirectories. It's not super convenient since you have to +avoid include cycles and including directories, but this can be done, eg: +`include */**/*.journal`. + +The path may also be prefixed to force a specific file format, +overriding the file extension (as described in +[hledger.1 -> Input files](hledger.html#input-files)): +`include timedot:~/notes/2020*.md`. [glob patterns]: https://hackage.haskell.org/package/Glob-0.9.2/docs/System-FilePath-Glob.html#v:compile