Thread: [Nice-commit] Nice/stdlib/nice/getopt gnugetopt.nice,1.6,1.7
Brought to you by:
bonniot
From: <ar...@us...> - 2003-06-15 13:15:30
|
Update of /cvsroot/nice/Nice/stdlib/nice/getopt In directory sc8-pr-cvs1:/tmp/cvs-serv30876/F:/nice/stdlib/nice/getopt Modified Files: gnugetopt.nice Log Message: Minor cleanup again. Index: gnugetopt.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/getopt/gnugetopt.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gnugetopt.nice 15 Jun 2003 11:52:17 -0000 1.6 --- gnugetopt.nice 15 Jun 2003 13:15:27 -0000 1.7 *************** *** 35,39 **** private ?String optarg = null; ! private ?String nextchar = null; private boolean posixly_correct = System.getProperty("gnu.posixly_correct", null) != null; private boolean longopt_handled = false; --- 35,39 ---- private ?String optarg = null; ! private String nextchar = ""; private boolean posixly_correct = System.getProperty("gnu.posixly_correct", null) != null; private boolean longopt_handled = false; *************** *** 166,179 **** exact = false; longind = -1; ! nameend = notNull(nextchar).indexOf("="); if (nameend == -1) ! nameend = notNull(nextchar).length(); // Test all lnog options for either exact match or abbreviated matches for (int i = 0; i < long_options.length; i++) { ! if (long_options[i].getName().startsWith(notNull(nextchar).substring(0, nameend))) { ! if (long_options[i].getName().equals(notNull(nextchar).substring(0, nameend))) { // Exact match found --- 166,179 ---- exact = false; longind = -1; ! nameend = nextchar.indexOf("="); if (nameend == -1) ! nameend = nextchar.length(); // Test all lnog options for either exact match or abbreviated matches for (int i = 0; i < long_options.length; i++) { ! if (long_options[i].getName().startsWith(nextchar.substring(0, nameend))) { ! if (long_options[i].getName().equals(nextchar.substring(0, nameend))) { // Exact match found *************** *** 213,222 **** ++optind; ! if (nameend != notNull(nextchar).length()) { if (pfound.has_arg != NO_ARGUMENT) { ! if (notNull(nextchar).substring(nameend).length() > 1) ! optarg = notNull(nextchar).substring(nameend+1); else optarg = ""; --- 213,222 ---- ++optind; ! if (nameend != nextchar.length()) { if (pfound.has_arg != NO_ARGUMENT) { ! if (nextchar.substring(nameend).length() > 1) ! optarg = nextchar.substring(nameend+1); else optarg = ""; *************** *** 281,285 **** return noOptionsLeft; ! if ((nextchar == null) || (nextchar.equals(""))) { // If we have just processed some options following some non-options, --- 281,285 ---- return noOptionsLeft; ! if (nextchar.equals("")) { // If we have just processed some options following some non-options, *************** *** 387,391 **** // Otherwise interpret it as a short option. if (!long_only || argv[optind].startsWith("--") ! || (optstring.indexOf(notNull(nextchar).charAt(0)) == -1)) { if (opterr) --- 387,391 ---- // Otherwise interpret it as a short option. if (!long_only || argv[optind].startsWith("--") ! || (optstring.indexOf(nextchar.charAt(0)) == -1)) { if (opterr) *************** *** 405,411 **** // Look at and handle the next short option-character */ ! char c = notNull(nextchar).charAt(0); ! if (notNull(nextchar).length() > 1) ! nextchar = notNull(nextchar).substring(1); else nextchar = ""; --- 405,411 ---- // Look at and handle the next short option-character */ ! char c = nextchar.charAt(0); ! if (nextchar.length() > 1) ! nextchar = nextchar.substring(1); else nextchar = ""; *************** *** 463,467 **** // Let the application handle it { ! nextchar = null; ++optind; return('W'); --- 463,467 ---- // Let the application handle it { ! nextchar = ""; ++optind; return('W'); *************** *** 484,488 **** } ! nextchar = null; } else --- 484,488 ---- } ! nextchar = ""; } else *************** *** 533,537 **** } ! nextchar = null; } } --- 533,537 ---- } ! nextchar = ""; } } |