hledger/shell-completion/Makefile

31 lines
822 B
Makefile
Raw Normal View History

2019-01-10 21:08:46 +03:00
.PHONY: command-options clean
2019-01-10 21:08:46 +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
m4 hledger-completion.bash.m4 > $@
2019-01-10 21:08:46 +03:00
generic-options.txt:
hledger -h | ./output-options.sh | sort -u > $@
2019-01-10 21:08:46 +03:00
commands.txt:
2019-01-10 21:13:28 +03:00
hledger | ./output-commands.sh | grep -v ^hledger > $@
echo ui >> $@
echo web >> $@
echo api >> $@
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'
command-options: commands.txt
parallel -j8 'hledger {} -h | ./output-options.sh | sort -u > options-{}.txt' < commands.txt
2019-01-10 21:08:46 +03:00
clean:
rm -f commands*.txt generic-options.txt options-*.txt
rm -f hledger-completion.bash