MCPcopy Create free account
hub / github.com/VSCodeConfigHelper/v4 / setup

Function setup

src-tauri/src/cli/prompt.rs:36–57  ·  view source on GitHub ↗
(arg: Option<&'static CompilerSetup>, y: bool)

Source from the content-addressed store, hash-verified

34}
35
36pub fn setup(arg: Option<&'static CompilerSetup>, y: bool) -> Result<&'static CompilerSetup> {
37 if y {
38 match arg {
39 Some(v) => Ok(v),
40 None => {
41 info!("未传入 -s,默认使用 {} 类型编译器", ENABLED_SETUPS[0].id);
42 Ok(ENABLED_SETUPS[0])
43 }
44 }
45 } else {
46 let q = Question::select("setup")
47 .message("编译器类型:")
48 .choices(
49 ENABLED_SETUPS
50 .iter()
51 .map(|s| format!("{} \x1b[38;5;242m({})\x1b[0m", s.name, s.description)),
52 )
53 .build();
54 let i = prompt_one(q)?.as_list_item().unwrap().index;
55 Ok(ENABLED_SETUPS[i])
56 }
57}
58
59pub fn compiler(setup: &'static CompilerSetup, arg: Option<String>, y: bool) -> Result<Compiler> {
60 if let Some(path) = arg {

Callers 2

cliFunction · 0.70
parseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected