Package jimm.util

Examples of jimm.util.Getopts.error()


* file name.
*/
public static void main(String[] args) {

  Getopts g = new Getopts("a:c:d:e:f:g:h:i:l:np:qr:s:wx:E:R:o:", args);
  if (g.error()) {    // Any bad command line argument?
    usage(null);    // If so, whine and exit
  }

  // Get user's preferences, if any.
  Preferences prefs = Preferences.userRoot().node("/jimm/datavision");
View Full Code Here


  "-a", "-b", "-c", "-f", "farg", "-g", "-eearg",
  "non-option-arg one", "non-option-arg two",
    };
    Getopts g = new Getopts("abcd:e:f:gh:i", args);

    assertTrue(!g.error());

    assertTrue(g.hasOption('a'));
    assertTrue(g.hasOption('b'));
    assertTrue(g.hasOption('c'));
    assertTrue(!g.hasOption('d'));
View Full Code Here

public void testSimpleCommandLine() {
    String[] args = { "-p", "password", "filename" };
    Getopts g = new Getopts("cdhlxnp:s:r:", args);

    assertTrue(!g.error());
    assertEquals("password", g.option('p'));
    assertEquals(1, g.argc());
    assertEquals("filename", g.argv(0));
}
View Full Code Here

    assertTrue(true);
}

public static void main(String[] args) {
    Getopts g = new Getopts("gjJ", args);
    if (g.error()) {
  System.err.println("usage: AllTests [-g] [-j] [-J]");
  System.err.println("  -g    Use GUI test runner (ignores -j and -J flags)");
  System.err.println("  -j    Run tests that rely upon JDBC and the database");
  System.err.println("  -J    Skip non-JDBC tests");
  System.exit(0);
View Full Code Here

    System.exit(1);
}

public static void main(String[] args) {
    Getopts g = new Getopts("hvd:c:s:u:p:", args);
    if (g.error() || g.hasOption('h') || !g.hasOption('d') || !g.hasOption('c')
  || !g.hasOption('u'))
  usage();

    boolean verbose = g.hasOption('v');
    try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.