MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_project_path

Function parse_project_path

atomic-cli/src/commands/project/mod.rs:53–58  ·  view source on GitHub ↗

Parse a combined `workspace/project` slug into its two components. # Errors Returns [`CliError::InvalidArgument`] if the input does not contain exactly one `/` separator.

(path: &str)

Source from the content-addressed store, hash-verified

51/// Returns [`CliError::InvalidArgument`] if the input does not contain
52/// exactly one `/` separator.
53pub fn parse_project_path(path: &str) -> CliResult<(&str, &str)> {
54 path.split_once('/')
55 .ok_or_else(|| CliError::InvalidArgument {
56 message: format!("Expected format 'workspace/project', got '{}'", path),
57 })
58}
59
60// ---------------------------------------------------------------------------
61// Subcommand dispatch

Callers 8

parse_project_path_validFunction · 0.85
runMethod · 0.85
test_invalid_slug_formatFunction · 0.85
test_valid_slug_parsingFunction · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls