jimtcl icon indicating copy to clipboard operation
jimtcl copied to clipboard

Inconsistent error messages

Open aryler opened this issue 5 years ago • 3 comments
trafficstars

string z => "bad option "z": must be bytelength, ... , or trimright" info z => "bad subcommand "z": must be alias, ... , or version" file z => "file, unknown command "z": should be atime, ... , isfile" If a cmd with subcmds is created in C: cmd z => "cmd, ambiguous command "z": should be something, ..., other"

Which form should I use for my programs?

aryler avatar Oct 22 '20 03:10 aryler

Tcl 8.6 does seems to be moving to towards standardising on "unknown or ambiguous subcommand ...", thus not differentiating between unknown and ambiguous, so that is a reasonable choice.

Although there are still situations where other wording is used.

% lsort -xxx z bad option "-xxx":

% interp z bad option "z":

msteveb avatar Oct 24 '20 04:10 msteveb

#194 harmonizes some error messages related to lsearch and lsort with Tcl 8.7.

dbohdan avatar Jan 30 '21 07:01 dbohdan

The https://github.com/msteveb/jimtcl/tree/cmd-register branch resolves this by consistently using JimCmdUsage() to report usage errors.

Welcome to Jim version 0.82
. string z
string, unknown command "z": should be bytelength, byterange, cat, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright
[error] . info z
info, unknown command "z": should be alias, args, body, channels, commands, complete, exists, frame, globals, help, hostname, level, locals, nameofexecutable, patchlevel, procs, references, returncodes, script, source, stacktrace, statics, tainted, usage, vars, version
[error] . file z
file, unknown command "z": should be atime, copy, delete, dirname, executable, exists, extension, isdirectory, isfile, join, link, lstat, mkdir, mtime, mtimeus, normalize, owned, readable, readlink, rename, rootname, size, split, stat, tail, tempfile, type, writable

msteveb avatar Aug 27 '23 00:08 msteveb