Artifacts Associated With Ticket 306945
Ticket change [88ed646070] (rid 131942) by msofer on 2010-09-17 20:41:05:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
the [regexp] compiler does option completion, but the normal command does not? % regexp -n FoO dogfood bad switch "-n": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or -- while evaluating {regexp -n FoO dogfood} % proc a {} {regexp -n FoO dogfood}; a 1 The completion feature is tested in regexpComp.test: 21.6-7 and 24.6-7 - foundin initialized to: "obsolete: 8.5.9"
- is_private initialized to: "0"
- priority initialized to: "8"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "43. Regexp"
- title initialized to: "difference between bcc'ed and eval'ed regexp"
- type initialized to: "Bug"
Ticket change [80a50cde44] (rid 116900) by hobbs on 2010-09-18 06:57:04:
- icomment:
Hmmm ... this seems to show that regexp itself is not consistent with standard Tcl option behavior, which is to allow uniq abbrs of options. Indeed, Tcl_RegexpObjCmd uses TCL_EXACT for getopts, whereas the compile cmd does a strcmp of len >= 2. It seems like it would be consistent to correct tclCompCmds.c to enforce the full -nocase, as regexp has behaved that way since 8.0, even if most Tcl commands allow abbr opts. Agreed?
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [3026e454c7] (rid 257516) by serhiy.storchaka on 2026-10-10 20:15:39:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- icomment:
Still the same in 8.6, 9.0 and 9.1: <tt>TclCompileRegexpCmd()</tt> accepts any prefix of <tt>-nocase</tt> of at least 2 characters, while <tt>Tcl_RegexpObjCmd()</tt> requires the full option name. <tt>string compare</tt>, <tt>string equal</tt>, <tt>string map</tt>, <tt>string match</tt>, <tt>switch</tt>, <tt>lsearch</tt> and <tt>lsort</tt> all accept abbreviations of <tt>-nocase</tt>. Proposed fix in branch [/timeline?r=regexp-nocase-abbrev|regexp-nocase-abbrev]: instead of making the compiler exact, the command also accepts abbreviations of <tt>-nocase</tt>. This breaks nothing, since it only turns errors into successes. Other options still need their full names. Tests regexp-30.1 to 30.3.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
Ticket change [1371752253] (rid 257797) by jan.nijtmans on 2026-10-12 20:00:26:
- assignee changed to: "jan.nijtmans"
- closer changed to: "nobody"
- comment changed to:
the [regexp] compiler does option completion, but the normal command does not? % regexp -n FoO dogfood bad switch "-n": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or -- while evaluating {regexp -n FoO dogfood} % proc a {} {regexp -n FoO dogfood}; a 1 The completion feature is tested in regexpComp.test: 21.6-7 and 24.6-7 - icomment:
Actually, I have a problem with some options within the same command being abbreviatable and others not. No other Tcl command does that. So, my proposal variant is: [e93dfd305ea29e3b]. In this specific case, I don't see any negative side-effect doing that. In general we should not advocate using abbreviated options, since it may cause incompatibilities if later options are added. But in manual typing in a shell, there's no harm, therefore many commands (especially when preceded with a minus-sign) allow that. We should - in my opinion - do the same here.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- severity changed to: "Minor"
Ticket change [49311822fd] (rid 257812) by serhiy.storchaka on 2026-10-12 20:37:46:
- icomment:
That is a decision for you. I only considered variants for <code>-nocase</code>: either make it never abbreviated (simpler, but breaking, and inconsistent with <code>-nocase</code> in other commands), or always abbreviated. Making all options abbreviatable is a wider change. Note that with all options abbreviatable some prefixes are ambiguous: <code>-a</code> (<code>-all</code>, <code>-about</code>) and <code>-i</code>/<code>-in</code> (<code>-indices</code>, <code>-inline</code>) in <code>regexp</code>, and <code>-l</code>/<code>-li</code>/<code>-lin</code> in both commands. <code>-line</code> can only be used in full, and <code>-a</code> would mean <code>-all</code> in <code>regsub</code> but be an error in <code>regexp</code>. <code>-n</code> is unique in both. Two related mismatches between compiled code and the command, where the compiler accepts an abbreviation that the command rejects as ambiguous: [1ae976e237] (<code>clock clicks -mi</code>, new in 9.1) and [8ab06e31e3] (<code>self n</code>).
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [0d7b2d3ad2] (rid 259099) by jan.nijtmans on 2026-10-18 21:15:12:
- icomment:
Merged to [43345b959d|trunk] and core-9-0-branch. Merge to 8.6 still to be done
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- icomment:
Ticket change [8a6a1569a9] (rid 261368) by oehhar on 2026-11-10 16:28:08:
- closedate changed to: "2461355.1862096298"
- closer changed to: "oehhar"
- login: "oehhar"
- mimetype: "text/plain"
- status changed to: "Closed"