Question about main

  • Thread starter Jesús Gabriel y Galán
  • Start date
J

Jesús Gabriel y Galán

Hi,

I'm trying to use main for the following case:

program.rb -d 120 -z 7 /folder1 /folder2 /folder3 ...

I'm using Ara's main gem. I know you can specify arity for a parameter
but I don't know if it's possible to capture all arguments:

require 'main'

main {
option("zip", "z") {
argument :required
description "Zip files older than the specified number of days"
cast :int
}
option("delete", "d") {
argument :required
defaults 7
description "Delete files older than the specified number of days.
If --zip option is specified, only delete the files that are in
between both dates"
cast :int
}
argument("folders") {
required
argument :required
arity 3 # but would like to capture all of them if there's more
}

def run
p params[:folders].values #I would like this to be all params
end
}

Is there a way?

Jesus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ANN main-4.4.0 0
[ANN] main-3.0.1 0
[ANN] main-4.0.0 (for avdi) 0
[ANN] main-2.8.3 2
[ANN] main-2.1.0 6
[ANN] main-2.6.0 0
[ANN] main-0.0.2 5
[ANN] main-2.0.0 6

Members online

Forum statistics

Threads
474,266
Messages
2,571,342
Members
48,018
Latest member
DelilahDen

Latest Threads

Top