Converts clap matches into a typed command.
(matches: &ArgMatches)
| 50 | |
| 51 | /// Converts clap matches into a typed command. |
| 52 | pub(crate) fn command_from_matches(matches: &ArgMatches) -> Result<RunnerCommand> { |
| 53 | match matches.subcommand() { |
| 54 | None | Some(("help", _)) => Ok(RunnerCommand::Help), |
| 55 | Some(("list", _)) => Ok(RunnerCommand::List), |
| 56 | Some((name, _)) => Err(exec_datafusion_err!("Unknown command '{name}'")), |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[cfg(test)] |
| 61 | mod tests { |
no outgoing calls
no test coverage detected
searching dependent graphs…