cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev)