apple / swift-argument-parser

Straightforward, type-safe argument parsing for Swift
Apache License 2.0
3.31k stars 311 forks source link

Enable shell detection for Windows #598

Closed stevapple closed 10 months ago

stevapple commented 10 months ago

The conventional SHELL environment variable is set by OpenSSH server on Windows, but we need to normalize the path slightly differently. Some popular shell names on Windows are cmd (Command Prompt), powershell (Windows Powershell), pwsh (Powershell Core) and bash (Git Bash).

Checklist

natecook1000 commented 10 months ago

Thanks, @stevapple! Do you know if the Bash completion scripts that ArgumentParser creates work on Windows?

compnerd commented 10 months ago

@natecook1000 no, they would not. There is no completion support for cmd.

natecook1000 commented 10 months ago

Since ArgumentParser's shell detection is only to support the completion script request, it doesn't sound like we need this change.