Use stderr and error exit codes on errors
I wanted to convert the AUR opensimulator
package but thought it was called opensim
, so I ran:
$ toAPK -u -a opensim aur > APKBUILD
$ cat APKBUILD
Resource not found, try a different source
toAPK could have just failed with an error code and printed to stderr so that the error does not go to the APKBUILD and is instead displayed in the terminal:
$ toAPK -u -a opensim aur > APKBUILD
Resource not found, try a different source
$ wc -c APKBUILD
0
If toAPK is used in another script or in a pipeline, this would also be very useful.