buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.4k stars 90 forks source link

ignore unknown options #136

Closed muescha closed 5 years ago

muescha commented 5 years ago

what i do:

i try to pin:

brew cu -pin abc
Pinned: in      

what i expected:

ondrejfuhrer commented 5 years ago

Hey @muescha , just tried it and it seems that he homebrew parser now throws error when option is not valid

~> brew cu -pin                                                                                                                                                      
Error: ambiguous option: -pin

Can you confirm?

muescha commented 5 years ago

no i can not confirm - it is still the same

> brew cu --pinned
eclipse-installer                                                                                                                                                       
eclipse-jee                                                                                                                                                             
java 

> brew cu -pin
Pinned: in    

> brew cu --pinned
eclipse-installer                                                                                                                                                       
eclipse-jee                                                                                                                                                             
java                                                                                                                                                                    
in  

but it seems that i have used only one - instead of two --

it look like it's a normal behavior for shortcut commands (shortcut is x -> -xvalue)

muescha commented 5 years ago

maybe we should add also the shortcuts to this commands:

> brew cu --help
[...]
  If --pinned is passed, print all pinned apps                                                                                                                          
  If --pin CASK is passed, pin the current app version                                                                                                                  
  If --unpin CASK is passed, unpin the current app version
ondrejfuhrer commented 5 years ago

@muescha yeah, I also used -pin in my example and it didn't work, that's why I asked. Could you paste here output from brew --version ? Maybe you have some older version?

muescha commented 5 years ago
> brew --version
Homebrew 2.0.5-14-g6253a78                                                                                                                                              
Homebrew/homebrew-core (git revision bf220; last commit 2019-03-20)                                                                                                     
Homebrew/homebrew-cask (git revision a12bc; last commit 2019-03-20) 
muescha commented 5 years ago

same with unpin:

> brew cu -unpin abc
Not pinned: npin   
ondrejfuhrer commented 5 years ago

@muescha So I've investigated the problem here and this is a "standard" behaviour of the ruby's option parser (it automatically enables "short" syntax for every option set).

I've added a manual check for that so it should not happen again.