add gcc completion for link lib (#10007)

* add completion for lib

* use path basename && use -a
This commit is contained in:
Asuka Minato 2023-09-09 15:29:39 +09:00 committed by GitHub
parent 5b44c26a19
commit 3bf80b2374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -482,7 +482,9 @@ complete -c gcc -s c -d 'Compile or assemble the source files, but do not link.'
complete -c gcc -s S -d 'Stop after the stage of compilation proper; do not assemble'
complete -c gcc -s E -d 'Stop after the preprocessing stage; do not run the compiler proper'
complete -c gcc -o llibrary -d 'Search the library named library when linking'
complete -c gcc -a '-l(path basename /usr/lib/lib*.so* | string match -r -g "^lib(.*?)\.so.*")'
complete -c gcc -s l -d 'Search the library named library when linking'
complete -c gcc -o ldl -d 'Search the dynamic loader library when linking'
complete -c gcc -o lm -d 'Search the math library when linking'
complete -c gcc -o lz -d 'Search the zlib library when linking'
complete -c gcc -o lrt -d 'Search the realtime extensions library when linking'