docs/tools: Improve bash-completion template and generation
This allows us to generate templates also for arguments expecting files (input, output) or PKCS#11 modules. The general ideal was already implemented, but never completed.
This commit is contained in:
parent
ccfd4b4c35
commit
1d49e8e0db
@ -36,8 +36,11 @@ tools.html: $(srcdir)/tools.xml $(wildcard $(srcdir)/*.1.xml) $(wildcard $(srcdi
|
||||
$(shell sed -n 's,.*<option>\([^<]*\)</option>.*<replaceable>.*,\1,pg' $< \
|
||||
| sort -u | grep -- '^\-' | tr '\n' '|' | sed 's,|$$,,')," \
|
||||
| sed "s,FILEOPTS,\
|
||||
$(shell sed -n 's,.*<option>\([^<]*\)</option>.*<replaceable>.*filename.*,\1,pg' $< \
|
||||
| sort -u | grep -- '^\-' | tr '\n' '|')," \
|
||||
$(shell sed -n 's,.*<option>\([^<]*\)</option>.*<replaceable>.*\(filename\|path\).*,\1,pg' $< \
|
||||
| sort -u | grep -- '^\-' | tr '\n' '|' | sed 's,|$$,,' | grep ^ || echo "!*")," \
|
||||
| sed "s,MODULEOPTS,\
|
||||
$(shell sed -n 's,.*<option>\([^<]*\)</option>.*<replaceable>.*mod.*,\1,pg' $< \
|
||||
| sort -u | grep -- '^\-' | tr '\n' '|' | sed 's,|$$,,' | grep ^ || echo "!*")," \
|
||||
| sed "s,FUNCTION_NAME,$(shell echo $@ | sed s,-,_,g)," \
|
||||
| sed "s,PROGRAM_NAME,$@," \
|
||||
> $@
|
||||
|
@ -15,6 +15,14 @@ _FUNCTION_NAME()
|
||||
fi
|
||||
|
||||
case "${prev}" in
|
||||
MODULEOPTS)
|
||||
_filedir so
|
||||
return 0
|
||||
;;
|
||||
FILEOPTS)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
OPTSWITHARGS)
|
||||
return 0
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user