diff options
| -rw-r--r-- | Cargo.lock | 7 | ||||
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | src/main.rs | 4 | 
3 files changed, 12 insertions, 0 deletions
| @@ -141,6 +141,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"  checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"  [[package]] +name = "exitcode" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193" + +[[package]]  name = "flate2"  version = "1.0.20"  source = "registry+https://github.com/rust-lang/crates.io-index" @@ -252,6 +258,7 @@ name = "pdf-form-replace-font"  version = "0.0.1"  dependencies = [   "anyhow", + "exitcode",   "getopts",   "lopdf",  ] @@ -5,5 +5,6 @@ edition = "2018"  [dependencies]  anyhow = "1.0.40" +exitcode = "1.1.2"  getopts = "0.2.21"  lopdf = "0.26.0" diff --git a/src/main.rs b/src/main.rs index 492707f..957dbe6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,10 @@  use anyhow::{self, Context}; +use exitcode;  use getopts::Options;  use lopdf::{Document, Object};  use std::env; +use std::process;  fn main() { @@ -10,6 +12,8 @@ fn main() {          Ok(_) => (),          Err(e) => {              eprintln!("error: {}", e); + +            process::exit(exitcode::SOFTWARE);          },      };  } | 
