MCPcopy Index your code
hub / github.com/PowerShell/DSC / main

Function main

dsc/src/main.rs:31–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29i18n!("locales", fallback = "en-us");
30
31fn main() {
32 #[cfg(debug_assertions)]
33 check_debug();
34
35 #[cfg(windows)]
36 check_store();
37
38 if ctrlc::set_handler(ctrlc_handler).is_err() {
39 error!("{}", t!("main.failedCtrlCHandler"));
40 }
41
42 let args = Args::parse();
43
44 util::enable_tracing(args.trace_level.as_ref(), args.trace_format.as_ref());
45
46 debug!("{}: {}", t!("main.usingDscVersion"), env!("CARGO_PKG_VERSION"));
47
48 let progress_format = args.progress_format.unwrap_or( ProgressFormat::Default );
49
50 match args.subcommand {
51 SubCommand::Completer { shell } => {
52 info!("{} {:?}", t!("main.generatingCompleter"), shell);
53 let mut cmd = Args::command();
54 generate(shell, &mut cmd, "dsc", &mut io::stdout());
55 },
56 SubCommand::Config { subcommand, parameters, parameters_file, system_root, as_group, as_assert, as_include } => {
57 let params = get_input(None, parameters_file.as_ref());
58 let file_params = if params.is_empty() {
59 None
60 } else {
61 Some(params)
62 };
63
64 let merged_parameters = match (file_params, parameters) {
65 (Some(file_content), Some(inline_content)) => {
66 info!("{}", t!("main.mergingParameters"));
67 match util::merge_parameters(&file_content, &inline_content) {
68 Ok(merged) => Some(merged),
69 Err(err) => {
70 error!("{}: {err}", t!("main.failedMergingParameters"));
71 exit(EXIT_INVALID_INPUT);
72 }
73 }
74 },
75 (Some(file_content), None) => Some(file_content),
76 (None, Some(inline_content)) => Some(inline_content),
77 (None, None) => None,
78 };
79
80 subcommand::config(&subcommand, &merged_parameters, system_root.as_ref(), &as_group, &as_assert, &as_include, progress_format);
81 },
82 SubCommand::Extension { subcommand } => {
83 subcommand::extension(&subcommand, progress_format);
84 },
85 SubCommand::Function { subcommand } => {
86 subcommand::function(&subcommand);
87 },
88 SubCommand::Mcp => {

Callers

nothing calls this directly

Calls 15

check_storeFunction · 0.85
get_inputFunction · 0.85
merge_parametersFunction · 0.85
configFunction · 0.85
extensionFunction · 0.85
functionFunction · 0.85
start_mcp_serverFunction · 0.85
resourceFunction · 0.85
write_objectFunction · 0.85
check_debugFunction · 0.70
enable_tracingFunction · 0.70
get_schemaFunction · 0.70

Tested by

no test coverage detected