Skip to content
Permalink
Browse files

Basic structure with Groovy CLI.

  • Loading branch information...
linhpham committed Aug 9, 2015
1 parent 8f3ce1b commit f938aa786fb44907d66fb8dec2b51c20236eb0b4
Showing with 28 additions and 0 deletions.
  1. +11 −0 Processor.groovy
  2. +17 −0 data-fix.groovy
@@ -0,0 +1,11 @@
class Processor {
def opts

Processor(opts) {
this.opts = opts
}

void run() {
println "Running..."
}
}
@@ -0,0 +1,17 @@
#!/usr/bin/env groovy

def cli = new CliBuilder(usage:'data-fix')
cli.with {
u longOpt: 'user', args: 1, argName: 'user', required: true, 'DB user'
p longOpt: 'password', args: 1, argName: 'password', required: true, 'DB password'
s longOpt: 'sourceSchema', args: 1, argName: 'sourceDbSchema', required: true, 'staging DB schema'
d longOpt: 'destinationSchema', args: 1, argName: 'destDbSchema', required: true, 'production DB schema'
h longOpt: 'host', args: 1, argName: 'dbHost', 'DB host, default to be localhost'
}

def opts = cli.parse(args)
if (!opts) {
System.exit(1)
}

new Processor(opts).run()

0 comments on commit f938aa7

Please sign in to comment.
You can’t perform that action at this time.