mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 17:02:45 +08:00
Add basic completion for mvn -pl switch (#8570)
This patch introduces basic completion of the -pl|--projects switch for mvn. The implementation is quite naive but it's better than nothing. A more robust implementation would require either scanning the filesystem or running mvn which might slow down completion significantly. This solution can be improved by using an XML parser instead of grep/sed.
This commit is contained in:
parent
1e503745a1
commit
69b5a3535c
|
@ -87,8 +87,13 @@ function __fish_mvn_profiles
|
||||||
sed -n -e '/<profile>/{n; s!^.*<id>\([^<]*\)</id>.*$!\1!; p}' ~/.m2/settings.xml pom.xml 2>/dev/null
|
sed -n -e '/<profile>/{n; s!^.*<id>\([^<]*\)</id>.*$!\1!; p}' ~/.m2/settings.xml pom.xml 2>/dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function __fish_mvn_projects
|
||||||
|
grep "<module>" pom.xml 2>/dev/null | sed 's/\s*<[^<]*>\(.*\)<[^<]*>/\1/'
|
||||||
|
end
|
||||||
|
|
||||||
complete -c mvn -f -r -o P -l activate-profiles -a "(__fish_mvn_profiles)" -d "Comma-delimited list of profiles to activate"
|
complete -c mvn -f -r -o P -l activate-profiles -a "(__fish_mvn_profiles)" -d "Comma-delimited list of profiles to activate"
|
||||||
|
|
||||||
|
complete -c mvn -f -r -o pl -l projects -a "(__fish_mvn_projects)" -d "Projects to build"
|
||||||
|
|
||||||
#default properties for some plugins / profiles
|
#default properties for some plugins / profiles
|
||||||
complete -c mvn -o DskipTests -d "Skipping JUnit Tests"
|
complete -c mvn -o DskipTests -d "Skipping JUnit Tests"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user