brew.rb: improve handling of --version/-v option
brew.rb: improve handling of --version/-v option

Make both `--version` and `-v` print the Homebrew version and exit, if
provided as first and sole argument. `brew --version` no longer accepts
additional arguments (they were previously ignored). Otherwise interpret
`brew -v <arguments>` as if `brew <arguments> -v` was executed instead
(no change here), but no longer print a line with the Homebrew version.

Closes Homebrew/homebrew#46790.

Signed-off-by: Martin Afanasjew <54669547a225ff20cba8b75a4adca540eef25858@afanasjew.de>

toonetown/homebrew,gordonmcshane/homebrew,nandub/brew,aw1621107/brew,claui/brew,maxim-belkin/brew,mistydemeo/homebrew,staticfloat/brew,rwhogg/brew,vitorgalvao/brew,Homebrew/brew,sjackman/homebrew,konqui/brew,Homebrew/brew,tonyg/homebrew,AnastasiaSulyagina/brew,muellermartin/dist,mistydemeo/homebrew,muellermartin/dist,mahori/brew,DomT4/brew,JCount/brew,mgrimes/brew,MikeMcQuaid/brew,palxex/brew,MikeMcQuaid/brew,sjackman/homebrew,JCount/brew,jmsundar/brew,sjackman/homebrew,tonyg/homebrew,EricFromCanada/brew,rwhogg/brew,MikeMcQuaid/brew,Linuxbrew/brew,amar-laksh/brew_sudo,DomT4/brew,ilovezfs/brew,staticfloat/brew,DomT4/brew,vitorgalvao/brew,jmsundar/brew,nandub/brew,gregory-nisbet/brew,sjackman/homebrew,mahori/brew,mistydemeo/homebrew,konqui/brew,DomT4/brew,reelsense/brew,konqui/brew,EricFromCanada/brew,vitorgalvao/brew,bfontaine/brew,hanxue/linuxbrew,aw1621107/brew,JCount/brew,rwhogg/brew,ilovezfs/brew,EricFromCanada/brew,claui/brew,Linuxbrew/brew,vitorgalvao/brew,muellermartin/dist,Homebrew/brew,gordonmcshane/homebrew,reitermarkus/brew,JCount/brew,Linuxbrew/brew,mahori/brew,reelsense/brew,reelsense/brew,nandub/brew,reitermarkus/brew,hanxue/linuxbrew,gordonmcshane/homebrew,staticfloat/brew,maxim-belkin/brew,bfontaine/brew,pseudocody/brew,palxex/brew,claui/brew,AnastasiaSulyagina/brew,ilovezfs/brew,reitermarkus/brew,claui/brew,hanxue/linuxbrew,tonyg/homebrew,palxex/brew,alyssais/brew,toonetown/homebrew,bfontaine/brew,mgrimes/brew,aw1621107/brew,toonetown/homebrew,MikeMcQuaid/brew,pseudocody/brew,EricFromCanada/brew,AnastasiaSulyagina/brew,amar-laksh/brew_sudo,gregory-nisbet/brew,Homebrew/brew,zmwangx/brew,gregory-nisbet/brew,jmsundar/brew,Linuxbrew/brew,pseudocody/brew,zmwangx/brew,alyssais/brew,alyssais/brew,nandub/brew,zmwangx/brew,maxim-belkin/brew,konqui/brew,amar-laksh/brew_sudo,mahori/brew,reitermarkus/brew,mgrimes/brew