Skip to content

Standardizing file error messages? #196

@GunterSchmidt

Description

@GunterSchmidt

I am researching the GNU error messages for the diffutils for file errors.

This topic is about: How far should we go to replicate GNU utils error messages?

Example with missing files:

  • cmp reports only the first missing file
$> cmp foo bar
cmp: foo: No such file or directory
  • diff reports both missing files at once
$> diff foo bar
diff: foo: No such file or directory
diff: bar: No such file or directory
  • diff3: reports only the last 2 of the missing files, but names 'diff' as util
$> diff3 foo bar org
diff: bar: No such file or directory
diff: org: No such file or directory
diff3: subsidiary program ‘diff’ failed (exit status 2)
  • sdiff reports diff as tool
$> sdiff foo bar
diff: foo: No such file or directory
diff: bar: No such file or directory

This gets even more odd, when starting the util in a sub-directory:

  • diff reports subdir
$> mydir/diff foo bar
mydir/diff: foo: No such file or directory
mydir/diff: bar: No such file or directory
  • sdiff does only report diff
    $> mydir/sdiff foo bar
    diff: foo: No such file or directory
    diff: bar: No such file or directory

Questions:

  1. Should the directory actually be part of the error message output?
    I do not think it is very helpful makes is harder to read.
  2. Should we check files like GNU, e.g. diff with both checks while cmp only with first file
    or should we standardize, e.g. always report all files (diff3 would then return three lines).

Returning sdiff for sdiff instead of diff would be helpful; one thinks the wrong util was used.

Best

Gunter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions