first steps

HI,

for the newbies to groovy and grails
There are many things for the experts, butfor the newbies, sometimes it´d a hard time, when justa little brick is missing.

I try to show may way to groovy and grails

Sunday, April 15, 2012

groovy: command line parameter / argument handling

Hi,

used from C, but there is not argc, argv.

it´s

args (Arry og arguments) and
args.size()  number of arguments

Like this

if ( args.size() != 4  )
  { println "Anzahl Argumente " + args.size()
    println "Usage:  pdf  Gutachten-nr  Datei  Zeile1  Zeile"
    return
  }

def nr = args[0]
def datei = args[1]
def zeile1 = args[2]
def zeile2 = args[3]

No comments:

Post a Comment