Revision 29716

Date:
2008/07/24 02:12:59
Author:
coke
Revision Log:
[tcl] pass another spec test in dict.test (and elsewhere, no doubt.) The
error message for an invalid subcommand is slightly different than that
for the options.

Files:

Legend:

 
Added
 
Removed
 
Modified
  • trunk/languages/tcl/runtime/options.pir

     
    50 50
    51 51 check_partial:
    52 52 $I1 = elements partials
    53 if $I1 == 0 goto no_match
    54 if $I1 >1 goto ambiguous
    53 if type_name == 'subcommand' goto check_subcommand
    54 if $I1 == 0 goto no_match_option
    55 if $I1 >1 goto ambiguous_option
    55 56 option = partials[0]
    56 57
    58 check_subcommand:
    59 if $I1 != 1 goto unknown_subcommand
    60 option = partials[0]
    61
    57 62 got_match:
    58 63 .return (option)
    59 64
    60 no_match:
    65 no_match_option:
    61 66 error = 'bad '
    62 67 error .= type_name
    63 68 error .= ' "'
     
    67 72 error .= $S1
    68 73 tcl_error error
    69 74
    70 ambiguous:
    75 ambiguous_option:
    71 76 error = 'ambiguous '
    72 77 error .= type_name
    73 78 error .= ' "'
     
    76 81 $S1 = optionsToString(options)
    77 82 error .= $S1
    78 83 tcl_error error
    84
    85 unknown_subcommand:
    86 error = 'unknown or ambiguous '
    87 error .= type_name
    88 error .= ' "'
    89 error .= choice
    90 error .= '": must be '
    91 $S1 = optionsToString(options)
    92 error .= $S1
    93 tcl_error error
    79 94 .end
    80 95
    81 96 =head1 hash options = _Tcl::select_switches(array switches, array argv, ?endswitch:0?, ?catchbad:0?, ?name: 'switch'?)