Skip to content
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

feat(getopt): Support option terminator (--) #5121

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

lewis-yeung
Copy link
Contributor

@lewis-yeung lewis-yeung commented Aug 23, 2022

Description

Support the option terminator -- in getopt, which is compatible with POSIX conventions for command line options (see reference for details).

Motivation and Context

This is also a prerequisite for fixing #5094.

How Has This Been Tested?

Tested locally with updated test/Scoop-GetOpts.Tests.ps1. All passed.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@niheaven
Copy link
Member

I've gotten it nearly in the same way, but the question is, PowerShell won't pass -- in its subprocess, so you canot get this -- in subcommand. A -- support in getopt has nothing to do with the bug.

@lewis-yeung
Copy link
Contributor Author

lewis-yeung commented Aug 23, 2022

but the question is, PowerShell won't pass -- in its subprocess, so you canot get this -- in subcommand. A -- support in getopt has nothing to do with the bug.

@niheaven We can pass '--' which is treated as a string in PowerShell. After all, it's impossible to use -- directly in PowerShell CLI.

Copy link
Member

@niheaven niheaven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, now could move on.

@niheaven niheaven merged commit e06c7f0 into ScoopInstaller:develop Aug 25, 2022
@lewis-yeung lewis-yeung deleted the getopt-enhancement branch August 25, 2022 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants