aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTeddy Wing2021-05-04 23:29:16 +0200
committerTeddy Wing2021-05-04 23:29:16 +0200
commite12178ffac507065d96ae8a5e1e3f33c6d05833a (patch)
tree44b3966616f9725663d882d06094572cdec5da68 /src/main.rs
parent6afe10b7ab6bc3ab6e096cdd219ea078d4a02b44 (diff)
downloadpdf-form-replace-font-e12178ffac507065d96ae8a5e1e3f33c6d05833a.tar.bz2
Add sysexits exit code
Doesn't capture input or I/O errors. Not bothering to return EX_NOINPUT or EX_IOERR or EX_CANTCREAT because I don't want to bother creating an error enum and variants for each case.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 4 insertions, 0 deletions
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);
},
};
}