Skip to content
Discussion options

You must be logged in to vote

@codenoobforreal You mean, you don't like the "Input required" default message? Try adding required(false) to offload validation fully to your validator closure:

let output = cliclack::input("Enter video output file or directory")
    .required(false)
    .validate_interactively(move |s: &String| {
      let trim_path = s.trim();
      if trim_path.is_empty() {
        return Err(anyhow!("Path cannot be empty"));
      }
      Ok(())
    })
    .interact::<String>()?;

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@codenoobforreal
Comment options

@fadeevab
Comment options

@codenoobforreal
Comment options

@fadeevab
Comment options

Answer selected by codenoobforreal
@codenoobforreal
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants