gradle / gradle-completion

Gradle tab completion for bash and zsh
MIT License
1.02k stars 131 forks source link

Completion for tasks only gives one option #77

Open jeeftor opened 4 years ago

jeeftor commented 4 years ago

I'm using ./gradlew on Mac

The __gradle-completion-init command generates this file:

bootRun:Runs this project as a Spring Boot application.\nassemble:Assembles the outputs of this project.\nbootJar:Assembles an executable jar archive containing the main classes and their dependencies.\nbuild:Assembles and tests this project.\nbuildDependents:Assembles and tests this project and all projects that depend on it.\nbuildNeeded:Assembles and tests this project and all projects it depends on.\nclasses:Assembles main classes.\nclean:Deletes the build directory.\njar:Assembles a jar archive containing the main classes.\ntestClasses:Assembles test classes.\ninit:Initializes a new Gradle build.\nwrapper:Generates Gradle wrapper files.\njavadoc:Generates Javadoc API documentation for the main source code.\nbuildEnvironment:Displays all buildscript dependencies declared in root project 'timeMonitor'.\ncomponents:Displays the components produced by root project 'timeMonitor'. [incubating]\ndependencies:Displays all dependencies declared in root project 'timeMonitor'.\ndependencyInsight:Displays the insight into a specific dependency in root project 'timeMonitor'.\ndependencyManagement:Displays the dependency management declared in root project 'timeMonitor'.\ndependentComponents:Displays the dependent components of components in root project 'timeMonitor'. [incubating]\nhelp:Displays a help message.\nkotlinDslAccessorsReport:Prints the Kotlin code for accessing the currently available project extensions and conventions.\nmodel:Displays the configuration model of root project 'timeMonitor'. [incubating]\nprojects:Displays the sub-projects of root project 'timeMonitor'.\nproperties:Displays the properties of root project 'timeMonitor'.\ntasks:Displays the tasks runnable from root project 'timeMonitor'.\ngenerateAvroJava:Generates main Avro Java source files from schema/protocol definition files.\ngenerateAvroProtocol:Generates main Avro protocol definition files from IDL files.\ngenerateTestAvroJava:Generates test Avro Java source files from schema/protocol definition files.\ngenerateTestAvroProtocol:Generates test Avro protocol definition files from IDL files.\ncheck:Runs all checks.\nspotlessApply:Applies code formatting steps to sourcecode in-place.\nspotlessCheck:Checks that sourcecode satisfies formatting steps.\ntest:Runs the unit tests.\ncompileJava:Compiles main Java source.\ncompileKotlin:Compiles the compilation 'main' (target  (jvm)).\ncompileTestJava:Compiles test Java source.\ncompileTestKotlin:Compiles the compilation 'test' (target  (jvm)).\ninspectClassesForKotlinIC:\ninstallGitHook:\nprepareKotlinBuildScriptModel:\nprocessResources:Processes main resources.\nprocessTestResources:Processes test resources.\nspotlessCpp:\nspotlessCppApply:\nspotlessCppCheck:\nspotlessJava:\nspotlessJavaApply:\nspotlessJavaCheck:\nspotlessKotlin:\nspotlessKotlinApply:\nspotlessKotlinCheck:\nspotlessKotlinGradle:\nspotlessKotlinGradleApply:\nspotlessKotlinGradleCheck:\nspotlessMisc:\nspotlessMiscApply:\nspotlessMiscCheck:\n

Which I assume is my completion file

However when I type ./gradlew <TAB> it always jumps to bootRun - am I missing something here?

If I give it a -<TAB> I get all the command line options which is awesome - but I was hoping for tab completion on tasks.

If I try something like ./gradlew c<TAB> nothing.

Thanks for any help that can be offered

jeeftor commented 4 years ago

Also using ZSH 5.3

eriwen commented 4 years ago

Hm... that \n in the file should be an actual line break.

I cannot reproduce this, so would you do the following so we can investigate further?