Coder Social home page Coder Social logo

Bash completions about wp-cli HOT 10 CLOSED

wp-cli avatar wp-cli commented on May 19, 2024
Bash completions

from wp-cli.

Comments (10)

andreascreten avatar andreascreten commented on May 19, 2024

I'm sure it's also possible on Mac, but I have nu clue how to do it.

from wp-cli.

scribu avatar scribu commented on May 19, 2024

I see homebrew has a few:

https://github.com/andreascreten/homebrew/blob/master/Library/Contributions/brew_bash_completion.sh
https://github.com/andreascreten/homebrew/blob/master/Library/Contributions/brew_fish_completion.fish
https://github.com/andreascreten/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh

from wp-cli.

andreascreten avatar andreascreten commented on May 19, 2024

Those are for zsh, the non default Mac shell. I prefer to go with the build in shell.

from wp-cli.

scribu avatar scribu commented on May 19, 2024

They're all for zsh? I see one for zsh, one for bash and one for fish.

from wp-cli.

andreascreten avatar andreascreten commented on May 19, 2024

I wrote a very basic implementation. But I'm afraid we have to do it dynamically somehow, because people will add commands from within their plugins.

from wp-cli.

scribu avatar scribu commented on May 19, 2024

It's better than no completion at all. :)

You could re-use the code that generates the list of commands when doing wp help.

from wp-cli.

scribu avatar scribu commented on May 19, 2024

We now have completions for sub-commands as well.

The problem is that now, after a completion, you can't go back and erase the command you wrote. The only thing you can do is type ahead and/or press ENTER.

It's obviously related to the invocation of the wp command, but I have no idea how to fix it.

from wp-cli.

scribu avatar scribu commented on May 19, 2024

It seems to be a problem specific to Ubuntu: http://stackoverflow.com/questions/3701226/bash-completion-prevents-backspace

from wp-cli.

andreascreten avatar andreascreten commented on May 19, 2024

On Mac it is working as expected (and totally kicking ass).

from wp-cli.

scribu avatar scribu commented on May 19, 2024

Ok, I think this is good enough for now. If I find a workaround for my Ubuntu problem, I'll just commit it.

from wp-cli.

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.