apiaryio/apiary-client — pull request #32 by honzajavorek (2014-04-13 17:49:10+00:00)
Title: Argument checking

Added simple validation of command line arguments. Closes #4.

There are few [examples of extensive OptionParser usage in the docs](http://www.ruby-doc.org/stdlib-2.1.1/libdoc/optparse/rdoc/OptionParser.html), so maybe there's more elegant solution, but I didn't feel like refactoring the code too much. Also, not being very experienced in Ruby, I chose the simplest implementation that seemed to work.

I rather guessed valid combinations of arguments - if an argument was mentioned in the code of command implementation, I assumed the command makes use of it. Review from someone with better knowledge of all `apiary-client`'s use cases would be great.

I changed the `CLI.run()` method so it accepts different parameters. Hopefully it won't break anything - I tried to check the code, but it seems nothing depends on it directly.

No new tests (specs?!) added, for now I only cared not to break any.