Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent error messages #176

Open
aryler opened this issue Oct 22, 2020 · 3 comments
Open

Inconsistent error messages #176

aryler opened this issue Oct 22, 2020 · 3 comments

Comments

@aryler
Copy link

aryler commented Oct 22, 2020

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?

@msteveb
Copy link
Owner

msteveb commented Oct 24, 2020

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":

@dbohdan
Copy link
Contributor

dbohdan commented Jan 30, 2021

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

@msteveb
Copy link
Owner

msteveb commented Aug 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants