File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,27 @@ add_subdirectory(man)
290290add_subdirectory (src )
291291
292292
293+ #-----------------------------------------------------------------------------
294+ #
295+ # Command line completions
296+ #
297+ # The completion files are installed into the locations where bash and zsh
298+ # look for them by default. Packagers can override the directories, Debian
299+ # for instance uses share/zsh/vendor-completions. Relative paths are
300+ # interpreted relative to the install prefix, absolute paths are used as is.
301+ #
302+ #-----------------------------------------------------------------------------
303+ option (INSTALL_COMPLETIONS "Install bash and zsh command line completions" ON )
304+
305+ set (BASH_COMPLETION_DIR "share/bash-completion/completions" CACHE STRING "Installation directory for the bash completion file" )
306+ set (ZSH_COMPLETION_DIR "share/zsh/site-functions" CACHE STRING "Installation directory for the zsh completion file" )
307+
308+ if (INSTALL_COMPLETIONS)
309+ install (FILES bash_completion/osmium DESTINATION ${BASH_COMPLETION_DIR} )
310+ install (FILES zsh_completion/_osmium DESTINATION ${ZSH_COMPLETION_DIR} )
311+ endif ()
312+
313+
293314#-----------------------------------------------------------------------------
294315#
295316# Tests
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ set(OSMIUM_INSTALL_FILES
2727 share/man/man5/osmium-file-formats.5
2828 share/man/man5/osmium-index-types.5
2929 share/man/man5/osmium-output-headers.5
30+ share/bash-completion/completions/osmium
31+ share/zsh/site-functions/_osmium
3032 bin/osmium
3133)
3234
You can’t perform that action at this time.
0 commit comments