phylum-dev / cli

Command line interface for the Phylum API
https://phylum.io
GNU General Public License v3.0
102 stars 10 forks source link

Return unique error code for disabled lockfile generation #1291

Closed maxrake closed 10 months ago

maxrake commented 10 months ago

The new --no-generation option for the parse/analyze commands is nice in that it tells you why the command failed:

❯ phylum parse -t cargo --no-generation ./Cargo.toml
❗ Error: could not parse lockfile: ./Cargo.toml

Caused by:
    Parsing "./Cargo.toml" requires lockfile generation, but it was disabled through the CLI

❯ echo $?
1

It would be even nicer if the exit code was unique instead of 1 like it is for other parse failures. That way it would be possible, when iterating over a range of dependency files, to recognize the --no-generation situation and skip over the manifests while allowing lockfiles to continue.