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

Suggestion See 'package -help' for more information. is probably wrong #7218

Open
valeriyvan opened this issue Dec 27, 2023 · 0 comments · May be fixed by #7224
Open

Suggestion See 'package -help' for more information. is probably wrong #7218

valeriyvan opened this issue Dec 27, 2023 · 0 comments · May be fixed by #7224
Labels

Comments

@valeriyvan
Copy link
Contributor

Description

swift package sdfgsdfgsdfgdfs produces following output:

swift package sdfgsdfgsdfgdfs
error: Unknown subcommand or plugin name ‘sdfgsdfgsdfgdfs’
Usage: swift package <options> <subcommand>
  See 'package -help' for more information.

But suggestion to use package -help is not helpful as it produces same suggestion:

swift package -help          
error: Unknown option '-help'
Usage: swift package <options> <subcommand>
  See 'package -help' for more information.

swift package -h or swift package --help work as expected.

This is confusing for user. Or custom long option -help is not working as expected or suggestion See 'package -help' for more information. is wrong.

Expected behavior

Or swift package -help should work or suggestion See 'package -help' for more information. should be fixed.

Actual behavior

Suggested swift package -help produces same suggestion to use swift package -help.

Steps to reproduce

  1. Run swift package sdfgsdfgsdfgdfs.
  2. Run suggested swift package -help

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

swift --version ; uname -a 
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin VV-LIN-MBP.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64
@valeriyvan valeriyvan added the bug label Dec 27, 2023
AndrewHoos added a commit that referenced this issue Jan 3, 2024
@AndrewHoos AndrewHoos linked a pull request Jan 3, 2024 that will close this issue
natecook1000 added a commit to apple/swift-argument-parser that referenced this issue Jan 3, 2024
When there's a default subcommand that captures pass-through args,
only a standalone help flag should trigger help (since the flag should
otherwise go to the subcommand). This fix makes that true for single-
dash help flag names, which were previously being skipped, due to
single-dash flags being lexed as both one whole flag and as a group of
individual short flags.

Re: apple/swift-package-manager#7218
Re: rdar://120422808
AndrewHoos added a commit that referenced this issue Jan 4, 2024
natecook1000 added a commit to apple/swift-argument-parser that referenced this issue Jan 4, 2024
When there's a default subcommand that captures pass-through args,
only a standalone help flag should trigger help (since the flag should
otherwise go to the subcommand). This fix makes that true for single-
dash help flag names, which were previously being skipped, due to
single-dash flags being lexed as both one whole flag and as a group of
individual short flags.

Re: apple/swift-package-manager#7218
Re: rdar://120422808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant