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
| Code | Meaning |
|---|---|
0 | success |
2 | bad command line, for example several inputs without -o |
65 | the file cannot be read: damaged, password-protected, old binary format, or not an Office file |
66 | the input cannot be opened (wrong path, no permission) |
74 | the output cannot be written |
75 | the 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
| Code | Meaning |
|---|---|
0 | the files are identical |
1 | the files are different |
2 | error: 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
| Code | Meaning |
|---|---|
0 | success. A closed pipe on -o - also ends with 0 |
2 | bad command line or an invalid combination of options |
3 | this kind or a feature of the input is not supported yet. Also a key the writer does not know |
65 | the input is not valid or cannot be written as asked |
66 | the input cannot be opened |
74 | the output cannot be written |
fetlar fill
| Code | Meaning |
|---|---|
0 | success |
2 | bad command line |
3 | the template uses something not supported (macros, Strict Open XML), or --strip-external refused something |
65 | the template or data is not valid, or a placeholder has no value |
66 | an input cannot be opened |
74 | the output cannot be written |
75 | over 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