#!/usr/bin/env node

var cmdArgs = require('cmd-args').create([
    ['h', 'help',         'Displays the help screen.'],
    ['r', 'red[=ARG+]',   'Colors the output red.'],
    ['g', 'green',        'Colors the output green.'],
    ['b', 'blue',         'Colors the output blue.'],
]);

var CMD_ARGS = cmdArgs.parse(process.argv.slice(2));

console.log(CMD_ARGS);

if (!CMD_ARGS.argv.length || CMD_ARGS.options.help) { // show help and exit
    console.log('\nUsage: <program> <flags> <filepath>');
    console.log('\nFlags:');
    console.log(cmdArgs.help());
    process.exit(0);
}

if (CMD_ARGS.error) { // show arg error and exit
    console.error(CMD_ARGS.error);
    process.exit(0);
}

@@ -57,16 +57,53 @@
 reate(%5B%0A
+//  %5B%3Calias%3E, %3Cflag%3E, %3Cdescription%3E%5D%0A
     %5B'h'
@@ -107,16 +107,17 @@
 'h',
+ 
  'help',
     
@@ -112,16 +112,22 @@
  'help',
+      
         
@@ -150,16 +150,99 @@
 elp 
-screen.'
+for this program.'%5D,%0A    %5B'f',  'firstname=ARG',      'Required firstname arg.'            
 %5D,%0A 
@@ -250,52 +250,145 @@
   %5B'
-r', 'red
+l',  'lastname
 %5B=ARG
-+
 %5D',
+  
    '
-Colors the output red
+Optional lastname arg.'             %5D,%0A    %5B'm',  'middlename%5B=ARG+%5D',  'Optional multiple middlename args
 .'
+ 
 %5D,%0A 
@@ -396,71 +396,91 @@
   %5B'
-g', 'green',        'Colors the output green.'%5D,%0A    %5B'b', 'blu
+v',  'verbose',            'Verbose boolean flag.'              %5D,%0A    %5Bnull, 'quit
 e', 
@@ -491,33 +491,50 @@
     
-'Colors the output blue.'
+     'Quite boolean flag no alias.'       
 %5D,%0A%5D
@@ -595,32 +595,8 @@
 );%0A%0A
-console.log(CMD_ARGS);%0A%0A
 if (
@@ -896,30 +896,48 @@
 rror);%0A    process.exit(0);%0A
-
 %7D%0A
+%0A// do stuff here%0A

Update example.js