Skip to content

Windows Powershell Completions Exception: Missing expression after ','. #482

Description

@thomasmansencal

Hi,

I just installed the latest from 0.15.0 to 0.19.0 and I now get this exception when launching Powershell on Windows:

PowerShell 7.5.4
ParserError: C:\Users\Fubar\Documents\PowerShell\OpenSpecCompletion.ps1:43
Line |
  43 |  … onfig"; Description="View and modify global OpenSpec configuration"},
     |                                                                         ~
     | Missing expression after ','.
PS C:\Users\Fubar>

This is caused by the trailing commas of the commands:

    if ($commandCount -eq 1 -or ($commandCount -eq 2 -and $wordToComplete)) {
        $commands = @(
            @{Name="init"; Description="Initialize OpenSpec in your project"},
            @{Name="update"; Description="Update OpenSpec instruction files"},
            @{Name="list"; Description="List items (changes by default, or specs with --specs)"},
            @{Name="view"; Description="Display an interactive dashboard of specs and changes"},
            @{Name="validate"; Description="Validate changes and specs"},
            @{Name="show"; Description="Show a change or spec"},
            @{Name="archive"; Description="Archive a completed change and update main specs"},
            @{Name="change"; Description="Manage OpenSpec change proposals (deprecated)"},
            @{Name="spec"; Description="Manage OpenSpec specifications"},
            @{Name="completion"; Description="Manage shell completions for OpenSpec CLI"},
            @{Name="config"; Description="View and modify global OpenSpec configuration"}, # <------ Trailing comma here.
        )
        $commands | Where-Object { $_.Name -like "$wordToComplete*" } | ForEach-Object {
            [System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, "ParameterValue", $_.Description)
        }
        return
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions