imag-ids: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
3cfe5f217c
commit
279751b99c
3 changed files with 6 additions and 2 deletions
|
@ -26,8 +26,9 @@ filters = "0.3"
|
||||||
nom = "3.2"
|
nom = "3.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
toml = "0.4"
|
toml = "0.4"
|
||||||
toml-query = "0.7"
|
toml-query = { git = "https://github.com/matthiasbeyer/toml-query", branch = "failure" }
|
||||||
is-match = "0.1"
|
is-match = "0.1"
|
||||||
|
failure = "0.1"
|
||||||
|
|
||||||
libimagstore = { version = "0.9.0", path = "../../../lib/core/libimagstore" }
|
libimagstore = { version = "0.9.0", path = "../../../lib/core/libimagstore" }
|
||||||
libimagrt = { version = "0.9.0", path = "../../../lib/core/libimagrt" }
|
libimagrt = { version = "0.9.0", path = "../../../lib/core/libimagrt" }
|
||||||
|
|
|
@ -51,6 +51,7 @@ pub mod header_filter_lang {
|
||||||
|
|
||||||
use nom::digit;
|
use nom::digit;
|
||||||
use nom::multispace;
|
use nom::multispace;
|
||||||
|
use failure::Error;
|
||||||
|
|
||||||
use libimagstore::store::Entry;
|
use libimagstore::store::Entry;
|
||||||
use libimagerror::trace::MapErrTrace;
|
use libimagerror::trace::MapErrTrace;
|
||||||
|
@ -403,6 +404,7 @@ pub mod header_filter_lang {
|
||||||
entry
|
entry
|
||||||
.get_header()
|
.get_header()
|
||||||
.read(selector_str)
|
.read(selector_str)
|
||||||
|
.map_err(Error::from)
|
||||||
.map_err_trace_exit_unwrap(1)
|
.map_err_trace_exit_unwrap(1)
|
||||||
.map(|value| {
|
.map(|value| {
|
||||||
let comp = Comparator(&self.compare_operator, &self.compare_value);
|
let comp = Comparator(&self.compare_operator, &self.compare_value);
|
||||||
|
|
|
@ -39,6 +39,7 @@ extern crate filters;
|
||||||
#[macro_use] extern crate is_match;
|
#[macro_use] extern crate is_match;
|
||||||
extern crate toml;
|
extern crate toml;
|
||||||
extern crate toml_query;
|
extern crate toml_query;
|
||||||
|
extern crate failure;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
@ -68,7 +69,7 @@ fn main() {
|
||||||
let version = make_imag_version!();
|
let version = make_imag_version!();
|
||||||
let rt = generate_runtime_setup("imag-ids",
|
let rt = generate_runtime_setup("imag-ids",
|
||||||
&version,
|
&version,
|
||||||
"Print all ids, optionally filtered with a user-defined filter",
|
"print all ids",
|
||||||
build_ui);
|
build_ui);
|
||||||
|
|
||||||
let print_storepath = rt.cli().is_present("print-storepath");
|
let print_storepath = rt.cli().is_present("print-storepath");
|
||||||
|
|
Loading…
Reference in a new issue