Skip to main content

Crate use_command_name

Crate use_command_name 

Source
Expand description

§use-command-name

Command and executable name primitives for RustUse CLI-adjacent code.

This crate validates command names and extracts executable names from paths. It does not implement command routing, subcommands, aliases, or dispatch.

§Example

use use_command_name::{CommandName, ExecutableName};

let command = CommandName::new("rustuse")?;
let executable = ExecutableName::new("rustuse.exe")?;

assert_eq!(command.as_str(), "rustuse");
assert_eq!(executable.display_name(), "rustuse.exe");

§Scope

Use this crate for explicit command name vocabulary, not parser or runtime behavior.

Modules§

prelude
Commonly used command name primitives.

Structs§

CommandName
A validated command name.
ExecutableName
A validated executable or binary name.

Enums§

CommandNameError
Validation errors for command and executable names.

Functions§

executable_name_from_path
Extracts a validated executable name from a path.
is_valid_command_name
Returns whether name is valid for this crate’s command name primitive.