MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / parse

Method parse

crates/opencode-cli/src/main.rs:2437–2448  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

2435
2436impl InstallMethod {
2437 fn parse(value: &str) -> Self {
2438 match value.trim().to_ascii_lowercase().as_str() {
2439 "curl" => Self::Curl,
2440 "npm" => Self::Npm,
2441 "pnpm" => Self::Pnpm,
2442 "bun" => Self::Bun,
2443 "brew" => Self::Brew,
2444 "choco" => Self::Choco,
2445 "scoop" => Self::Scoop,
2446 _ => Self::Unknown,
2447 }
2448 }
2449
2450 fn as_str(self) -> &'static str {
2451 match self {

Callers 2

run_tuiFunction · 0.45
run_server_commandFunction · 0.45

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected