xa11y 0.9.0

Cross-platform accessibility client library — unified API for reading and interacting with accessibility trees
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::process;

use xa11y::cli::CliError;

fn main() {
    let args: Vec<String> = std::env::args().skip(1).collect();
    if let Err(e) = xa11y::cli::run(&args) {
        // `CliError`'s Display already prefixes usage errors with
        // "usage error: "; everything else gets the generic prefix.
        // Exit codes: 1 = operation failed / no match, 2 = usage error
        // (see `CliError::exit_code` and the CLI help text).
        match &e {
            CliError::Usage(_) => eprintln!("{e}"),
            _ => eprintln!("error: {e}"),
        }
        process::exit(e.exit_code());
    }
}