librebar 0.1.0

Opinionated application foundation for Rust CLIs and services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![allow(missing_docs)]
#![cfg(feature = "dispatch")]

use librebar::dispatch;

#[test]
fn find_subcommand_binary_name() {
    let name = dispatch::subcommand_binary("myapp", "serve");
    assert_eq!(name, "myapp-serve");
}

#[test]
fn resolve_returns_none_for_missing_command() {
    let result = dispatch::resolve("librebar-test-nonexistent-42", "fakecmd");
    assert!(result.is_none());
}