Skip to main content

label

Function label 

Source
pub fn label(command: &str) -> String
Expand description

Derive a short label from a command string.

Extracts the first word of the command (typically the binary name), stripping any path prefix. For example:

  • “cargo test” → “cargo”
  • “/usr/bin/python script.py” → “python”
  • “gh issue list” → “gh”

§Arguments

  • command - The command string

§Returns

A short label derived from the command.