xq 0.2.6

A reimplementation of jq.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::process::Command;

fn main() {
    lalrpop::process_root().unwrap();

    let package_version = env!("CARGO_PKG_VERSION");
    let git_revision = Command::new("git")
        .args(&["rev-parse", "HEAD"])
        .output()
        .ok()
        .and_then(|o| String::from_utf8(o.stdout).ok())
        .map(|s| s.trim().to_string());
    if let Some(git_revision) = git_revision {
        println!("cargo:rustc-env=LONG_VERSION={package_version}-{git_revision}");
    } else {
        println!("cargo:rustc-env=LONG_VERSION={package_version}");
    }
}