MCPcopy Create free account
hub / github.com/archlinux/alpm / main

Function main

alpm-srcinfo/src/main.rs:17–47  ·  view source on GitHub ↗

The entry point for the `alpm-srcinfo` binary. Parses the CLI arguments and calls the respective [`alpm_srcinfo`] library functions.

()

Source from the content-addressed store, hash-verified

15///
16/// Parses the CLI arguments and calls the respective [`alpm_srcinfo`] library functions.
17fn main() -> ExitCode {
18 let cli = Cli::parse();
19 let result = match cli.command {
20 Command::Create {
21 file,
22 output_format,
23 pretty,
24 } => create(&file, output_format, pretty),
25 Command::Validate { file, schema } => validate(file.as_ref(), schema),
26 Command::Format {
27 file,
28 schema,
29 output_format,
30 pretty,
31 } => format_source_info(file.as_ref(), schema, output_format, pretty),
32 Command::FormatPackages {
33 file,
34 schema,
35 architecture,
36 output_format,
37 pretty,
38 } => format_packages(file.as_ref(), schema, output_format, architecture, pretty),
39 };
40
41 if let Err(error) = result {
42 eprintln!("{error}");
43 ExitCode::FAILURE
44 } else {
45 ExitCode::SUCCESS
46 }
47}

Callers

nothing calls this directly

Calls 6

format_source_infoFunction · 0.85
format_packagesFunction · 0.85
parseFunction · 0.70
createFunction · 0.70
validateFunction · 0.70
as_refMethod · 0.45

Tested by

no test coverage detected