-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zsh completion for sub-commands adds an extra slash and fails to complete sub-command options #153
Comments
As far as I can tell, The issue of the options not getting added to the sub-command has to do with the case patterns in the
The above syntax is inelegant, but the generated glob patterns that get added to the completions script account for the 3 different ways of invoking sub-commands (that I know of), and the same goes for commands. The following invocation patterns would show associated options:
What I'm using:
|
Reopening, since not all issues mentioned here were resolved. |
@Secrus If you take a look at what I mentioned above, you'll see that I only made a change in one place to get the sub-commands to operate correctly. The sub-commands don't need to be quoted in the
The issue in the zsh script before the most recent change appeared to be with the sub-command patterns in the The following are examples of how I invoked the command:
or
or
Hope this helps. |
@mickyhale thanks. The patch I made recently was mostly addressing issues with completions script reporting errors when invoked. I have a refactor on the way that will introduce new syntax to the completions script, especially for commands with subcommands. I have it on hold since right now we want to focus on delivering a new stable version since it breaks some Poetry use cases (python-poetry/poetry#6353). |
ReportCompletions for commands with spaces show in ~ ❯ poetry --version
Poetry (version 1.7.1)
~ ❯ zsh --version
zsh 5.9 (x86_64-ubuntu-linux-gnu) ~ ❯ poetry <tab>
'cache clear' -- Clears a Poetry cache by name.
'cache list' -- List Poetry's caches.
'debug info' -- Shows debug information.
'debug resolve' -- Debugs dependency resolution.
'env info' -- Displays information about the current environment.
'env list' -- Lists all virtualenvs associated with the current project.
'env remove' -- Remove virtual environments associated with the project.
'env use' -- Activates or creates a new virtualenv for the current project.
'self add' -- Add additional packages to Poetry's runtime environment.
'self install' -- Install locked packages (incl. addons) required by this Poetry installation.
'self lock' -- Lock the Poetry installation's system requirements.
'self remove' -- Remove additional packages from Poetry's runtime environment.
'self show plugins' -- Shows information about the currently installed plugins.
'self show' -- Show packages from Poetry's runtime environment.
'self update' -- Updates Poetry to the latest version.
'source add' -- Add source configuration for project.
'source remove' -- Remove source configured for the project.
'source show' -- Show information about sources configured for the project.
about -- Shows information about Poetry.
add -- Adds a new dependency to pyproject.toml.
build -- Builds a package, as a tarball and a wheel by default.
check -- Validates the content of the pyproject.toml file and its consistency with the poetry.lock file.
config -- Manages configuration settings.
export -- Exports the lock file to alternative formats.
help -- Displays help for a command.
init -- Creates a basic pyproject.toml file in the current directory.
install -- Installs the project dependencies.
list -- Lists commands.
lock -- Locks the project dependencies.
new -- Creates a new Python project at <path>.
publish -- Publishes a package to a remote repository.
remove -- Removes a package from the project dependencies.
run -- Runs a command in the appropriate environment.
search -- Searches for packages on remote repositories.
shell -- Spawns a shell within the virtual environment.
show -- Shows information about packages.
update -- Update the dependencies as according to the pyproject.toml file.
version -- Shows the version of the project or bumps it when a valid bump rule is provided. |
With the beta version 1.2.0b1 of Poetry I can see that sub-commands and their options show up in the generated zsh completion script.
However, there is some weird behavior when trying to tab-complete on zsh command line.
First of all, it completes the sub-command with an additional slash:
poetry env\ info
– which is not a valid command..poetry env
+ tab adds the slash and shows the expected subcommands:Also, with this my zsh is unable to autocomplete the option(s) for the subcommand. I was trying
poetry env info --p
+ tab, hoping to get--path
completed but zsh just offers the global options of poetry:References:
poetry env
is missing sub-commands & options poetry#1855 (comment)The text was updated successfully, but these errors were encountered: