phinze/homebrew-cask — pull request #1526 by aah (2013-11-07 22:48:17+00:00)
Title: Guard against unspecified cask in CLI

Hello, all!

First and foremost, thank you for all of your work on homebrew-cask. It's great.

This pull request improves the way the CLI handles missing arguments, making it more consistent with homebrew proper. Specifically, it ensures that naked calls print a useful message to stderr and exit with a status of 1.

Before:
```
~ $ brew cask edit
Error: undefined method `include?' for nil:NilClass
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.19.4/rubylib/cask/locations.rb:44:in `path'
/usr/local/Cellar/brew-cask/0.19.4/rubylib/cask/cli/edit.rb:4:in `run'
/usr/local/Cellar/brew-cask/0.19.4/rubylib/cask/cli.rb:35:in `process'
/usr/local/bin/brew-cask.rb:6
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:97
```
```
~ $ brew cask install && echo 'foo'
foo
~ $ echo $?
0
```

After:
```
~ $ brew cask edit
This command requires a cask argument
```

```shell
~ $ brew cask install && echo 'foo'
This command requires a cask argument
~ $ echo $?
1
```