@Override public String run(String[] args){
  if (args.length == 1) {
    String help="#nova print : will print all of your current nova networks and unlinked units.\n";
    help+="#nova print 5 : will print the network status for the Unit with ID 5.\n";
    help+="#nova link 5 6 : will link the units with ID 5 and 6.\n+++Will Disconnect them from all prior nets.\n";
    help+="#nova link 5 6 7 : will link the three units with ID 5 6 and 7.\n+++Will Disconnect them from all prior nets.\n";
    help+="#nova unlink : will unlink all your novaCEWS units.\n";
    help+="#nova unlink 5 : will unlink unit with ID 5 from all nova networks.\n";
    return help;
  }
  try {
    if (args.length > 1) {
      String cmd=args[1];
      if (cmd == "print") {
        if (args.length > 2) {
          int id=Integer.parseInt(args[2]);
          return strListNetwork(id,true);
        }
 else {
          return strListNetworks(true);
        }
      }
 else       if (cmd == "link") {
        if (args.length > 4) {
          int id1=Integer.parseInt(args[2]);
          int id2=Integer.parseInt(args[3]);
          int id3=Integer.parseInt(args[4]);
          return strLink3(id1,id2,id3);
        }
 else         if (args.length > 3) {
          int id1=Integer.parseInt(args[2]);
          int id2=Integer.parseInt(args[3]);
          return strLink2(id1,id2);
        }
      }
 else       if (cmd == "unlink") {
        if (args.length > 2) {
          int id=Integer.parseInt(args[2]);
          return strUnlinkID(id);
        }
 else {
          return strUnlinkAll();
        }
      }
      return "Unknown command. #nova for help.\n";
    }
  }
 catch (  NumberFormatException nfe) {
  }
catch (  NullPointerException npe) {
  }
catch (  IndexOutOfBoundsException ioobe) {
  }
  return "Error parsing the command.";
}

@ Override public String run ( String [ ] args ) { if ( args . length == 1 ) { String help = "#nova print : will print all of your current nova networks and unlinked units.\n" ; help += "#nova print 5 : will print the network status for the Unit with ID 5.\n" ; help += "#nova link 5 6 : will link the units with ID 5 and 6.\n+++Will Disconnect them from all prior nets.\n" ; help += "#nova link 5 6 7 : will link the three units with ID 5 6 and 7.\n+++Will Disconnect them from all prior nets.\n" ; help += "#nova unlink : will unlink all your novaCEWS units.\n" ; help += "#nova unlink 5 : will unlink unit with ID 5 from all nova networks.\n" ; return help ; } try { if ( args . length > 1 ) { String cmd = args [ 1 ] ; if ( cmd == "print" ) { if ( args . length > 2 ) { int id = Integer . parseInt ( args [ 2 ] ) ; return strListNetwork ( id , true ) ; } else { return strListNetworks ( true ) ; } } else if ( cmd == "link" ) { if ( args . length > 4 ) { int id1 = Integer . parseInt ( args [ 2 ] ) ; int id2 = Integer . parseInt ( args [ 3 ] ) ; int id3 = Integer . parseInt ( args [ 4 ] ) ; return strLink3 ( id1 , id2 , id3 ) ; } else if ( args . length > 3 ) { int id1 = Integer . parseInt ( args [ 2 ] ) ; int id2 = Integer . parseInt ( args [ 3 ] ) ; return strLink2 ( id1 , id2 ) ; } } else if ( cmd == "unlink" ) { if ( args . length > 2 ) { int id = Integer . parseInt ( args [ 2 ] ) ; return strUnlinkID ( id ) ; } else { return strUnlinkAll ( ) ; } } return "Unknown command. #nova for help.\n" ; } } catch ( NumberFormatException nfe ) { } catch ( NullPointerException npe ) { } catch ( IndexOutOfBoundsException ioobe ) { } return "Error parsing the command." ; }
run this command with the arguments supplied
