aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/einhyrningsinsctl.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/einhyrningsinsctl.rs b/src/bin/einhyrningsinsctl.rs
index c057b9e..0e55073 100644
--- a/src/bin/einhyrningsinsctl.rs
+++ b/src/bin/einhyrningsinsctl.rs
@@ -108,17 +108,23 @@ fn main() {
let mut opts = Options::new();
opts.optflag("h", "help", "print this help menu");
+ opts.optflag("", "version", "print the version");
let matches = match opts.parse(&args[1..]) {
Ok(m) => { m }
Err(f) => { println!("{}", f.to_string()); print_usage(opts); exit(-1); }
};
- if matches.opt_present("h") {
+ if matches.opt_present("help") {
print_usage(opts);
return;
}
+ if matches.opt_present("version") {
+ println!("einhyrningsinsctl {}", env!("CARGO_PKG_VERSION"));
+ return;
+ }
+
// Bind to Control Socket
let ctrl_path = Path::new("/tmp/einhorn.sock");
// XXX: handle this more gracefully (per-process)