#!/usr/bin/env/node

/*

   Provide a command-line interface for `reconfigure`.
  ___ greeting, usage ___ en_US ___
  usage: node.bin.js

  ___ serve, usage ___ en_US ___
  usage: node bin.js reconfigure server

  options:
  -l, --listen      [string]    IP and port to bind to.
  -i, --id          [string]    reconfigure instance ID (or IP)
  ___ ___ ___
*/

require('arguable')(module, require('cadence')(function (async, options) {
    switch (options.command[0]) {
        case 'serve':
            console.log('coming soon')
            if ((options.param.listen != null) || (options.param.id != null)) {
                console.log('bind:' + options.param.listen + ' id:' + options.param.id)
            }
            break
        case 'greeting':
            if (options.param.string != null) {
                console.log(options.param.string)
            } else {
                console.log('Hello, World!')
            }
            break
    }
}))

@@ -485,16 +485,41 @@
 serve':%0A
+            var ip, port%0A
         
@@ -566,12 +566,12 @@
    i
-f ((
+p = 
 opti
@@ -590,152 +590,252 @@
 sten
- != null) %7C%7C (options.param.id != null)) %7B%0A                console.log('bind:' + options.param.listen + ' id:' + options.param.id)%0A            %7D
+.split(':')%0A            if (ip.length) %7B%0A                port = ip%5B1%5D%0A                ip = ip%5B0%5D%0A            %7D else %7B%0A                port = '8080'%0A                ip = ip%5B0%5D%0A            %7D%0A            console.log('ip: ' + ip + ' port: ' + port)
 %0A   

Split IP and port from input.