Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are manymany other existingexisting questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this forfor bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

replaced http://serverfault.com/ with https://serverfault.com/
Source Link

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions aboutabout this for bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

zsh has a completion system, activated by pressing tab:

llama@llama:~$ git st<Tab>
Completing main porcelain command
stash      -- stash away changes to dirty working directory
status     -- show working-tree status
Completing plumbing internal helper command
stripspace -- filter out empty lines

All I've been able to figure out is that this comes from the script /usr/share/zsh/functions/Completion/Unix/_git, where _git is the completion command being called.

Assuming I know the name of the completion function (e.g. _git), how could I get the output of what would happen if I entered a certain string and pressed tab? Essentially, I'm trying to take an input of ex. git st and get the output above (programmatically, from a script).

There are many other existing questions about this for bash, but I haven't found anything explaining how to achieve this with zsh.

Tweeted twitter.com/StackUnix/status/778074492291653632
Source Link
Doorknob
  • 3.3k
  • 1
  • 18
  • 20
Loading