Skip to main content

systemprompt_cli/shared/
parsers.rs

1//! CLI value parsers for fail-fast validation at command line boundaries.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use systemprompt_identifiers::{Email, ProfileName};
7
8pub fn parse_profile_name(s: &str) -> Result<ProfileName, String> {
9    ProfileName::try_new(s).map_err(|e| e.to_string())
10}
11
12pub fn parse_email(s: &str) -> Result<Email, String> {
13    Email::try_new(s).map_err(|e| e.to_string())
14}