Add bash-completion for tox-bootstrapd

This commit is contained in:
Maxim Biro 2022-02-08 19:16:32 -05:00
parent 8002c35c79
commit 2965403e2c
No known key found for this signature in database
GPG Key ID: AB3AD9896472BFA4
4 changed files with 33 additions and 2 deletions

View File

@ -555,6 +555,7 @@ if(BOOTSTRAP_DAEMON)
other/bootstrap_node_packets.h) other/bootstrap_node_packets.h)
target_link_modules(tox-bootstrapd toxcore ${LIBCONFIG_LIBRARIES}) target_link_modules(tox-bootstrapd toxcore ${LIBCONFIG_LIBRARIES})
install(TARGETS tox-bootstrapd RUNTIME DESTINATION bin) install(TARGETS tox-bootstrapd RUNTIME DESTINATION bin)
install(FILES other/bootstrap_daemon/bash-completion/completions/tox-bootstrapd DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions")
endif() endif()
endif() endif()

View File

@ -0,0 +1,27 @@
# tox-bootstrapd completion -*- shell-script -*-
_tox_bootstrapd()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
--config)
_filedir
return
;;
--log-backend)
COMPREPLY=($(compgen -W 'stdout syslog' -- "$cur"))
return
;;
esac
$split && return
if type _bashcomp_try_faketty &>/dev/null; then
COMPREPLY=($(compgen -W '$(_parse_help _bashcomp_try_faketty "$1" --help)' -- "$cur"))
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
fi
} && complete -F _tox_bootstrapd tox-bootstrapd
# ex: filetype=sh

View File

@ -21,6 +21,7 @@ WORKDIR /src/c-toxcore
# lying around. In particular, we don't need to rebuild the docker image when # lying around. In particular, we don't need to rebuild the docker image when
# toxav changes or the Dockerfile changes down from the build. # toxav changes or the Dockerfile changes down from the build.
COPY cmake cmake COPY cmake cmake
COPY other/bootstrap_daemon/bash-completion other/bootstrap_daemon/bash-completion
COPY other/bootstrap_daemon/src other/bootstrap_daemon/src COPY other/bootstrap_daemon/src other/bootstrap_daemon/src
COPY other/bootstrap_node_packets.[ch] other/ COPY other/bootstrap_node_packets.[ch] other/
COPY other/DHT_bootstrap.c other/ COPY other/DHT_bootstrap.c other/

View File

@ -36,10 +36,12 @@ tox_bootstrapd_LDADD = \
$(NACL_OBJECTS) \ $(NACL_OBJECTS) \
$(NACL_LIBS) $(NACL_LIBS)
endif bashcompdir = $(datarootdir)/bash-completion/completions
dist_bashcomp_DATA = $(top_builddir)/other/bootstrap_daemon/bash-completion/completions/tox-bootstrapd
EXTRA_DIST += \ EXTRA_DIST += \
$(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.conf \ $(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.conf \
$(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.service \ $(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.service \
$(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.sh $(top_srcdir)/other/bootstrap_daemon/tox-bootstrapd.sh
endif