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

[Bug] scoop alias list --verbose - --verbose not recognized #6061

Closed
mattcargile opened this issue Jul 17, 2024 · 4 comments · Fixed by #6062 or #6080
Closed

[Bug] scoop alias list --verbose - --verbose not recognized #6061

mattcargile opened this issue Jul 17, 2024 · 4 comments · Fixed by #6062 or #6080
Labels

Comments

@mattcargile
Copy link
Contributor

mattcargile commented Jul 17, 2024

Bug Report

Current Behavior

scoop alias list --verbose returns scoop alias: Option --verbose not recognized..

Expected Behavior

It should output the Summary property.

Additional context/output

scoop alias list -v and scoop alias list -verbose works. Docs scoop alias --help reflects --verbose.

Possible Solution

I assume it is something with this line.

$opt, $other, $err = getopt $Args 'v' , 'verbose'

The edit would be a removal of the comment since verbose is a long option.

$opt, $other, $err = getopt $Args 'v' 'verbose'

Once removed, the other problematic UX, is that scoop alias list -verbose returns scoop alias: Option -e not recognized. which is confusing as a user. I'd expect a return of -verbose isn't an option. I assume this is a bug in getopt.

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 7.4.3

Additional software:

Scoop Configuration

{
  "last_update": "2024-07-16T23:32:30.2674510-05:00",
  "alias": {
    "finfo": "scoop-finfo",
    "fsearch": "scoop-fsearch"
  },
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master"
}
@lewis-yeung
Copy link
Contributor

I'd expect a return of -verbose isn't an option. I assume this is a bug in getopt.

That's by design, since the getopt function conforms to the GNU standard for parsing long and short CLI options.

@mattcargile
Copy link
Contributor Author

I'd expect a return of -verbose isn't an option. I assume this is a bug in getopt.

That's by design, since the getopt function conforms to the GNU standard for parsing long and short CLI options.

It is by design to say Option -e not recognized when a user passes in -verbose? "I didn't pass in any -e" . Or maybe I am missing something?

@lewis-yeung
Copy link
Contributor

lewis-yeung commented Jul 18, 2024

@mattcargile Yes. In GNU/POSIX standard, the single-hyphen prefixed -verbose passed by user is parsed as mixed short options: -v, -e, -r, -b, -o, -s and -e again.

@mattcargile
Copy link
Contributor Author

@mattcargile Yes. In GNU/POSIX standard, the single-hyphen prefixed -verbose passed by user is parsed as mixed short options: -v, -e, -r, -b, -o, -s and -e again.

Ah, of course! That is embarrassing for me. :'-)

Thanks for breaking down. That didn't immediately occur to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants