Giter VIP home page Giter VIP logo

Comments (12)

dsifford avatar dsifford commented on September 27, 2024

I'm not sure I understand what the error here is.

There is not a test:coverage command. That is a valid error.

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

It was autocompleted, for whatever reason. Notice that cov was not offered, for example.

Also, nothing gets completed with just test:.

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

Oh, just figured out why coverage was completed, I have a folder named like that:

$ ls
coverage  nest-cli.json  package.json  src   tsconfig.build.json  yarn.lock
dist      node_modules   README.md     test  tsconfig.json
$ touch x123
$ yarn run test:x<TAB>123 ^C

from yarn-completion.

dsifford avatar dsifford commented on September 27, 2024

Did you try the suggestion in the bottom of the readme?

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

Just now (didn't notice it before). It behaves the same, only the options are presented differently. It would still complete coverage, for example.

from yarn-completion.

dsifford avatar dsifford commented on September 27, 2024

Then yeah not sure I'm able to do anything about it. I tried looking into this in the past and came up short.

Happy to hear suggestions though.

from yarn-completion.

dsifford avatar dsifford commented on September 27, 2024

I've got package.json files with a similar convention and have found it not a big deal to do yarn t<Tab><Tab><Tab> to get test:cov completed.

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

This looks related: https://stackoverflow.com/a/12495727/672885

from yarn-completion.

dsifford avatar dsifford commented on September 27, 2024

Already do that

declare COMP_WORDBREAKS=$' \t\n"\'><=;|&(:'

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

No, this specifically avoids redefining it, quote:

modifying COMP_WORDBREAKS in your completion script is not safe (as it is a global variable and it has the side effect of affecting the behavior of other completion scripts - for example scp).
Therefore, bash completion offers some helper methods which you can use to achieve your goal in a better and more safer way.

I've checked with Maven, which uses this and the difference is their completion escapes the character:

$ mvn <TAB><TAB>
assembly:assembly                  dependency:sources
clean                              dependency:tree
compile                            dependency:unpack
dependency:analyze                 dependency:unpack-dependencies
dependency:analyze-dep-mgt         deploy
dependency:analyze-duplicate       eclipse:eclipse
dependency:analyze-only            idea:idea
dependency:analyze-report          install
dependency:build-classpath         package
dependency:copy                    plexus:app
dependency:copy-dependencies       plexus:bundle-application
dependency:get                     plexus:bundle-runtime
dependency:go-offline              plexus:descriptor
dependency:list                    plexus:runtime
dependency:properties              plexus:service
dependency:purge-local-repository  site
dependency:resolve                 test/
dependency:resolve-plugins         verify
$ mvn depe<TAB>ndency\:<TAB>
dependency:analyze                 dependency:list
dependency:analyze-dep-mgt         dependency:properties
dependency:analyze-duplicate       dependency:purge-local-repository
dependency:analyze-only            dependency:resolve
dependency:analyze-report          dependency:resolve-plugins
dependency:build-classpath         dependency:sources
dependency:copy                    dependency:tree
dependency:copy-dependencies       dependency:unpack
dependency:get                     dependency:unpack-dependencies
dependency:go-offline              
$ mvn dependency\:ana<TAB>lyze<TAB>
dependency:analyze            dependency:analyze-only
dependency:analyze-dep-mgt    dependency:analyze-report
dependency:analyze-duplicate  

from yarn-completion.

dkarlovi avatar dkarlovi commented on September 27, 2024

Adding the backslash manually does work, I get test\:cov completed correctly (but it again removes the backslash).

Escaping special chars like colons, spaced etc would probably fix it without other changes.

from yarn-completion.

dsifford avatar dsifford commented on September 27, 2024

Fixed in #48

from yarn-completion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.