diff --git a/bin/core/imag-ids/src/ui.rs b/bin/core/imag-ids/src/ui.rs index c4080c8d..61007f14 100644 --- a/bin/core/imag-ids/src/ui.rs +++ b/bin/core/imag-ids/src/ui.rs @@ -46,5 +46,6 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .value_names(&["QUERY"]) .help("Query the header of the entries and filter them")) ) + .after_help(include_str!("../static/language-doc.md")) } diff --git a/bin/core/imag-ids/static/language-doc.md b/bin/core/imag-ids/static/language-doc.md new file mode 100644 index 00000000..362c5877 --- /dev/null +++ b/bin/core/imag-ids/static/language-doc.md @@ -0,0 +1,51 @@ +Language documentation for the imag-ids query language +====================================================== + +The query language imag-ids supports is rather simple. +It can be used to filter the printed imag ids by the values in the header of the +entries. It has no way to access the content of the entries (yet). + +Following is a BNF-like structure shown how the language definition works. +This definition may change over time, as the language grews more powerful. + +```ignore +query = filter (operator filter)* + +filter = unary? ( (function "(" selector ")" ) | selector ) op val + +unary = "not" + +op = + "is" | + "in" | + "==" | + "eq" | + "!=" | + "neq" | + ">=" | + "<=" | + "<" | + ">" | + "any" | + "all" + +val = val | listofval + +val = string | int | bool +listofval = "[" (val ",")* "]" + +operator = + "or" | + "or_not" | + "and" | + "and_not" | + "xor" + +function = + "length" | + "keys" | + "values" +``` + +A "string" quoted with double-quotes. +A "val" does not yet support floats.