Skip to content

Commit f3906f4

Browse files
jtojnarscop
authored andcommitted
docs(README): Suggest using completionsdir as a fallback
If the `bash-completion.pc` file is not available during build, the build system would fall back to using the legacy `compatdir`. Let’s update the fallback to make it consistent with the optimistic branch.
1 parent 8892eb9 commit f3906f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ A. [ Disclaimer: Here, how to make the completion code visible to
192192

193193
```m4
194194
PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
195-
bashcompdir="${sysconfdir}/bash_completion.d")
195+
bashcompdir="${datadir}/bash-completion/completions")
196196
AC_SUBST(bashcompdir)
197197
```
198198

@@ -207,12 +207,13 @@ A. [ Disclaimer: Here, how to make the completion code visible to
207207
`bash-completion-config-version.cmake` files. Example usage:
208208
209209
```cmake
210+
include(GNUInstallDirs)
210211
find_package(bash-completion)
211212
if(BASH_COMPLETION_FOUND)
212213
message(STATUS
213214
"Using bash completion dir ${BASH_COMPLETION_COMPLETIONSDIR}")
214215
else()
215-
set (BASH_COMPLETION_COMPLETIONSDIR "/etc/bash_completion.d")
216+
set (BASH_COMPLETION_COMPLETIONSDIR "${CMAKE_INSTALL_DATADIR}/bash-completion/completions")
216217
message (STATUS
217218
"Using fallback bash completion dir ${BASH_COMPLETION_COMPLETIONSDIR}")
218219
endif()

0 commit comments

Comments
 (0)