Skip to Content
Fetlar
Reference

Exit codes

What each exit code of the fetlar command means.

A program that runs fetlar can read the exit code to know how it went.

Reading files

CodeMeaning
0success
2bad command line, for example several inputs without -o
65the file cannot be read: damaged, password-protected, old binary format, or not an Office file
66the input cannot be opened (wrong path, no permission)
74the output cannot be written
75the file is over a safety limit (expanded size or number of parts), or took longer than --timeout

With several inputs, the exit code is 0 when every file converted. Otherwise it is the code of the first input (in the order you gave them) that failed.

fetlar diff

CodeMeaning
0the files are identical
1the files are different
2error: an unreadable file, a pair that does not compare, a file over a safety limit, a timeout, or an output that cannot be written

fetlar write

CodeMeaning
0success. A closed pipe on -o - also ends with 0
2bad command line or an invalid combination of options
3this kind or a feature of the input is not supported yet. Also a key the writer does not know
65the input is not valid or cannot be written as asked
66the input cannot be opened
74the output cannot be written

fetlar fill

CodeMeaning
0success
2bad command line
3the template uses something not supported (macros, Strict Open XML), or --strip-external refused something
65the template or data is not valid, or a placeholder has no value
66an input cannot be opened
74the output cannot be written
75over a safety limit, or --timeout

In a script

fetlar diff old.xlsx new.xlsx > changes.txt
case $? in
  0) echo "No changes" ;;
  1) echo "Changed. See changes.txt" ;;
  *) echo "Could not compare" ;;
esac

On this page