The entry point for the `alpm-srcinfo` binary. Parses the CLI arguments and calls the respective [`alpm_srcinfo`] library functions.
()
| 15 | /// |
| 16 | /// Parses the CLI arguments and calls the respective [`alpm_srcinfo`] library functions. |
| 17 | fn 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 | } |
nothing calls this directly
no test coverage detected