would it be good to give a usage example in cli.rb? #8

andywenk opened this Issue Nov 18, 2012 · 4 comments


None yet

2 participants


first of all +1 for creating ruby-lint. I think it would be cool to have an example in cli.rb how to use the programm. It was nit clear for me, that it's not possible to use more than one analyzer.

Btw. - are you planning to support the usage of more than one analyzer at the same time?




Similar as to your pull request I'll add some examples to the help output once the AST branch is merged (hopefully I can do this next weekend). And currently it actually is possible to use more than one analyser at the same time, you can do so by specifying multiple names separated by a comma:

$ ruby-lint some_ruby_file.rb -a undefined_variables,unused_variables

By default all the constants defined under `RubyLint::Analyze`` are used. In the future you'll also be able to customize this using a directory specific and/or global configuration file.

ok cool ...

Btw. I tried to use more analysers but it did not work, because I did it wrong. So this works:

$ ruby-lint -a undefined_variables some_ruby_file.rb 

but this doesn't

$ ruby-lint -a undefined_variables,unused_variables some_ruby_file.rb

I once ran into that also when using Optparser. You already showed the basic example but in my experience, users tend to run into issues like that. So examples are really good to have.

I will checkout if I can do some work on that and send another pull request tonight ;-)


Hm, it could be that I'm mistaken about the syntax required to specify multiple variables for an option. Either way, from a technical perspective it is possible though I agree it needs to be clarified.

andywenk commented Mar 8, 2013


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment