Skip to content

Commit

Permalink
feat: enforce services must be have at least one item
Browse files Browse the repository at this point in the history
  • Loading branch information
augustoccesar committed Nov 10, 2023
1 parent bdab3fe commit 44812f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion linkup-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ enum Commands {

#[arg(
help = "<service>=<url> pairs to preview.",
value_parser = ValueParser::new(preview::parse_services_tuple)
value_parser = ValueParser::new(preview::parse_services_tuple),
required = true,
num_args = 1..,
)]
services: Vec<(String, String)>,

Expand Down
5 changes: 0 additions & 5 deletions linkup-cli/src/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ pub fn preview(
services: &[(String, String)],
print_request: bool,
) -> Result<(), CliError> {
if services.is_empty() {
// TODO: Oliver don't care about this error handling (type)
return Err(CliError::BadConfig("No services specified".to_string()));
}

let config_path = config_path(config)?;
let input_config = get_config(&config_path)?;
let create_preview_request: CreatePreviewRequest =
Expand Down

0 comments on commit 44812f2

Please sign in to comment.