mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Add object files to ninja completions
When working on a C or C++ projects, it is often handy to compile a single file (e.g. large refactoring where many files fail to compile so compiling a single file results in less compiler errors making the compiler output significantly easier to read and navigate). Current completion offers only ninja targets which are usually just top level binaries. This commit makes object files and library files to be offered in the ninja completion. The change is inspired by the zsh ninja completion [1], but aims to reduce noise by only matching for entries ending in ".o", ".so" or ".a". [1]c828f06e08/src/zsh/_ninja (L30)
(cherry picked from commit2e89e0c205
)
This commit is contained in:
parent
99254d74fe
commit
bfe47e5979
|
@ -13,6 +13,7 @@ end
|
|||
|
||||
function __fish_print_ninja_targets
|
||||
__fish_ninja -t targets 2>/dev/null | string replace -r ':.*' ''
|
||||
__fish_ninja -t targets all 2>/dev/null | string replace -r ':.*' '' | string match -e -r '\.(?:o|so|a)$'
|
||||
end
|
||||
complete -c ninja -f -a '(__fish_print_ninja_targets)' -d target
|
||||
complete -x -c ninja -s t -x -a "(__fish_print_ninja_tools)" -d subtool
|
||||
|
|
Loading…
Reference in New Issue
Block a user