-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add powershell completions #9307
Add powershell completions #9307
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Luap99 LGTM, you have some formatting issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really review this: I've never actually used MS Windows. I have no way to know if this will work, or to verify your Get-Help
or other man page instructions.
I found one super-minor typo, and have one question for the team at large.
I did confirm your Makefile changes, and did consistency checks on man pages. All looks good.
One question: the .ps1
files you're submitting seem to have been generated with this version of cobra:
$ ./bin/podman completion powershell|diff -u - completions/powershell/podman.ps1
[no output, exit status 0]
The other completion files are generated using cobra with various unmerged patches (sorry, I can't keep track of the precise details). My understanding is that the .ps1
files aren't used at all, but if someone Windows-savvy figures out how to distribute them, would it be useful for you to submit .ps1
files including your custom cobra changes?
@@ -59,7 +59,7 @@ Options: | |||
|
|||
var ( | |||
rootCmd = &cobra.Command{ | |||
Use: path.Base(os.Args[0]) + " [options]", | |||
Use: filepath.Base(os.Args[0]) + " [options]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tentatively LGTM, and seems to be consistent with other uses of Base
in the code, but it's the sort of change I'd like a lot of eyeballs on. @containers/podman-maintainers PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important for windows since the path package splits only on a regular slash even on windows.
I implemented the powershell completion upstream spf13/cobra#1208 All my changes are in there :) |
You could theoretically install powershell on linux. Not that you would ever want or need that. |
I've a few man page changes to consider. The code looks fine with an eyeball revied, but like @edsantiago, I don't have an easy way to test it at the moment. |
Friendly ping (going through PRs at the moment) |
e909028
to
ace5745
Compare
Updated with @TomSweeneyRedHat doc fixes. If you want to test it you can run the following. Make sure you have the podman service is running. $ make podman-remote-static
$ podman run -it -v $(pwd)/bin/podman-remote-static:/bin/podman-remote -v /run/user/1000/podman/podman.sock:/run/podman/podman.sock --security-opt label=disable --rm mcr.microsoft.com/powershell
PowerShell 7.1.2
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /> podman-remote completion powershell | Out-String | Invoke-Expression
PS /> podman-remote [TAB] |
ace5745
to
debbda4
Compare
LGTM |
A friendly reminder that this PR had no activity for 30 days. |
/lgtm Sorry about spacing out on this. Holding because I get nervous when merging from an old base; I'll leave you the choice of unholding or rebasing. If you rebase, I promise to re-lgtm ASAP. |
Add support for generating powershell completion files. This is especially useful for people using the podman remote client on windows. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
debbda4
to
6a78fca
Compare
I lost track of this as well. I rebased, better than breaking the CI. |
/lgtm |
/hold cancel |
Add support for generating powershell completion files. This is especially
useful for people using the podman remote client on windows.