cargo-okf 0.2.5

The okf CLI as a cargo subcommand: validate, lint, inspect, index, graph, format, and diff Open Knowledge Format (OKF) bundles with cargo okf.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `cargo okf`: the `okf` CLI as a cargo subcommand.
//!
//! Cargo invokes external subcommands as `cargo-okf okf <args...>`, passing
//! the subcommand name as the first argument; strip it so `cargo okf validate`
//! and a direct `cargo-okf validate` behave identically. Everything else is
//! the `okf` CLI, shared via `okf::cli`.

use std::process::ExitCode;

fn main() -> ExitCode {
    let mut args: Vec<String> = std::env::args().skip(1).collect();
    if args.first().map(String::as_str) == Some("okf") {
        args.remove(0);
    }
    okf::cli::run(&args)
}