Please add non zero exit status for vsql if specified file is not exists
$ vsql -f nonexisting.sql && echo OK || echo FAIL nonexisting.sql: No such file or directory OK
Same problem with included files
$ vsql -a -f error.sql && echo OK || echo FAIL
\set ON_ERROR_STOP on
\i nonexisting.sql
vsql:error.sql:2: nonexisting.sql: No such file or directory
select 2;
?column?
----------
2
(1 row)
OK
vsql continues execution without stopping