Skip to main content

parse_sign_target

Function parse_sign_target 

Source
pub fn parse_sign_target(raw_target: &str) -> SignTarget
Expand description

Resolves raw CLI input into a concrete target type.

Checks the filesystem first. If no file exists at the path, assumes a Git reference.

Args:

  • raw_target - The raw string input from the CLI.

Usage:

let target = parse_sign_target("HEAD");
assert!(matches!(target, SignTarget::CommitRange(_)));