Summary
The PowerShellCompletionGenerator has several correctness bugs and is missing features that all other generators (bash, zsh, fish) support. Test coverage is also significantly weaker than the other shells.
Correctness Bugs
1. Dynamic generator tokenization breaks on quoted arguments
$commandAst.ToString().Split(' ') splits on spaces, which breaks quoted arguments:
# User types: mycli --message "hello world"
# Split produces: mycli, --message, "hello, world" (WRONG)
Fix: Use $commandAst.CommandElements which provides proper tokenization.
2. Program name not quoted in dynamic generator
& programName --aesh-complete breaks if the program name contains spaces. Should be & 'programName'.
3. Missing property option filtering
isProperty() is never checked. @OptionGroup properties are emitted as regular options. All other generators skip property options.
4. Error messages omit pwsh
AeshRuntimeRunner.java lines 508, 519, 652 say "Supported: bash, zsh, fish" but omit pwsh.
5. System.lineSeparator() vs "\n"
The generator uses System.lineSeparator() which produces \r\n on Windows. All other generators use "\n". Can cause issues when script is generated on Windows but used on Linux pwsh.
Feature Parity Gaps
All of the following are supported by bash, zsh, and fish generators but missing from PowerShell:
| Feature |
Impact |
Option aliases (getAliases()) |
--config not suggested if only --configuration emitted |
Short names (shortName()) |
-v never offered alongside --verbose |
Negatable options (isNegatable()) |
--no-verbose never emitted |
Value completion (allowedValues/defaultValues) |
Enum values not listed as candidates |
File options (isTypeAssignableByResourcesOrFile()) |
No Get-ChildItem fallback for file-type options |
Arguments (@Argument/@Arguments) |
Positional arguments completely ignored |
Test Coverage Gaps
| What |
Bash |
Zsh |
Fish |
PowerShell |
| Option aliases |
Yes |
Yes |
Yes |
No |
| Negatable options |
Yes |
Yes |
Yes |
No |
| Value completion |
Yes |
Yes |
Yes |
No |
| File options |
Yes |
Yes |
implicit |
No |
| Multi-arguments |
Yes |
Yes |
Yes |
No |
--aesh-completion --static |
Yes |
Yes |
Yes |
No |
detectShell() unit tests |
— |
— |
— |
No |
| Integration (run actual shell) |
No |
No |
No |
No |
Related
Summary
The
PowerShellCompletionGeneratorhas several correctness bugs and is missing features that all other generators (bash, zsh, fish) support. Test coverage is also significantly weaker than the other shells.Correctness Bugs
1. Dynamic generator tokenization breaks on quoted arguments
$commandAst.ToString().Split(' ')splits on spaces, which breaks quoted arguments:Fix: Use
$commandAst.CommandElementswhich provides proper tokenization.2. Program name not quoted in dynamic generator
& programName --aesh-completebreaks if the program name contains spaces. Should be& 'programName'.3. Missing property option filtering
isProperty()is never checked.@OptionGroupproperties are emitted as regular options. All other generators skip property options.4. Error messages omit pwsh
AeshRuntimeRunner.javalines 508, 519, 652 say "Supported: bash, zsh, fish" but omit pwsh.5. System.lineSeparator() vs "\n"
The generator uses
System.lineSeparator()which produces\r\non Windows. All other generators use"\n". Can cause issues when script is generated on Windows but used on Linux pwsh.Feature Parity Gaps
All of the following are supported by bash, zsh, and fish generators but missing from PowerShell:
getAliases())--confignot suggested if only--configurationemittedshortName())-vnever offered alongside--verboseisNegatable())--no-verbosenever emittedallowedValues/defaultValues)isTypeAssignableByResourcesOrFile())Get-ChildItemfallback for file-type options@Argument/@Arguments)Test Coverage Gaps
--aesh-completion --staticdetectShell()unit testsRelated