main
main copied to clipboard
a class factory and dsl for generating command line programs real quick
The following program should just print its arguments: ``` ruby require 'main' Main do argument('args') { arity -1 } def run param['args'].values.each{|arg| puts arg} end end ``` However, when the...
I get this when using the gem sekrets which uses this gem, with ruby 3.0.0: /home/jack/.rvm/gems/ruby-3.0.0/gems/main-6.2.3/lib/main/program/instance_methods.rb:56: warning: finalizer references object to be finalized Any ideas, other than to disable warnings?
I'd like to use this library but with a custom Array, is iit possible to use something else than ARGV?
Avoid a warning that is triggered in util.rb with ruby 2.5: /usr/lib/ruby/vendor_ruby/main/util.rb:47: warning: constant ::Fixnum is deprecated In https://github.com/sass/sass/issues/2218 I found a discussion whether they tested the replacement to "Integer"...
What's the correct was for an option to take a list of values, e.g. myprogram --sources google facebook microsoft or myprogram --sources google,facebook,microsoft In the first example, I can't seem...
Assuming I have an application distributed as a gem using main, what is the best way to test the application using the main interface without manually have to create a...
An option with arity 1 does not fail if 2 values are passed. See the example below: ``` require 'main' ARGV.replace %w(--foo=bar --foo=baz) Main { option('foo', 'f'){ required arity 1...
When I just require main in a ruby program and I am at the root of my home dir, it freezes my Ruby process. In order to reproduce I can:...
@ahoward, I've corrected a typographical error in the documentation of the [main](https://github.com/ahoward/main) project. Specifically, I've changed contruction to construction. You should be able to merge this pull request automatically. However,...
@ahoward, I've corrected a typographical error in the documentation of the [main](https://github.com/ahoward/main) project. You should be able to merge this pull request automatically. However, if this was intentional or if...