2019-01-10 21:08:46 +03:00
|
|
|
|
2019-01-12 15:03:17 +03:00
|
|
|
.PHONY: command-options clean
|
2019-01-10 21:08:46 +03:00
|
|
|
|
2019-01-12 15:03:17 +03:00
|
|
|
all: command-options hledger-completion.bash
|
|
|
|
|
2019-01-19 02:23:42 +03:00
|
|
|
hledger-completion.bash: hledger-completion.bash.m4 commands-list.txt query-filters.txt generic-options.txt
|
2019-01-12 15:03:17 +03:00
|
|
|
m4 hledger-completion.bash.m4 > $@
|
2019-01-10 21:08:46 +03:00
|
|
|
|
|
|
|
generic-options.txt:
|
|
|
|
hledger -h | ./output-options.sh > $@
|
|
|
|
|
|
|
|
commands.txt:
|
2019-01-10 21:13:28 +03:00
|
|
|
hledger | ./output-commands.sh | grep -v ^hledger > $@
|
2019-01-10 21:08:46 +03:00
|
|
|
|
|
|
|
commands-list.txt: commands.txt
|
|
|
|
paste -sd, $^ | tr -d '\n' > $@
|
|
|
|
|
2019-01-19 23:46:07 +03:00
|
|
|
#query-filters.txt:
|
|
|
|
# The query filters are hard to extract!
|
|
|
|
# hledger help --cat hledger | sed -n '/^QUERIES/,/^[A-Z]/p'
|
|
|
|
|
2019-01-12 15:03:17 +03:00
|
|
|
command-options: commands.txt
|
2019-01-12 14:24:09 +03:00
|
|
|
parallel -j8 'hledger {} -h | ./output-options.sh > options-{}.txt' < commands.txt
|
2019-01-10 21:08:46 +03:00
|
|
|
|
|
|
|
clean:
|
2019-01-10 21:10:42 +03:00
|
|
|
rm -f *.txt hledger-completion.bash
|