corectl icon indicating copy to clipboard operation
corectl copied to clipboard

corectl with PowerShell

Open glooms opened this issue 5 years ago • 1 comments

I've been diving into PowerShell and seeing what we can do in terms of tab completion.

Cobra has some built in support for PowerShell completion, however, there are some problems related to installing and sourcing the completion.

In PowerShell i could curl down the zip but had to create my own unzip function. Furthermore you have to source the completion script by first piping it to a file (and possibly change permissions).

To make corectl a tool that works well for Windows users would require quite a bit of work. Probably by building a modified version of the cobra's existing completion. Also, the executable takes arguments and parameters in way that will seem foreign in a PowerShell context.

In conclusion, adapt corectl to the PowerShell context would probably include the following tasks

  • [ ] Offer corectl on to chocolaty or find another smooth installation way
  • [ ] Tweak/rebuild cobra's PowerShell completion generation
  • [ ] Optional Adapt corectl to fit the PowerShell context in terms of how flags and arguments are passed.

This is by no means trivial.

glooms avatar Jun 14 '19 15:06 glooms

Good analysis and summary. We need to think about the ROI.

Windows users, please feel free to add your thoughts!

sublibra avatar Jun 14 '19 15:06 sublibra