background_picker/lib.rs
1mod app;
2pub mod cache;
3mod cli;
4mod error;
5pub mod scanner;
6pub mod thumbnail;
7
8pub use app::BackgroundPickerApp;
9pub use cli::Args;
10pub use error::{BackgroundPickerError, Result};
11pub use scanner::{ImageInfo, is_image_file};
12
13/// # Errors
14///
15/// Returns an error if `command` is empty or contains only whitespace.
16pub fn validate_command(command: &str) -> Result<()> {
17 if command.trim().is_empty() {
18 return Err(BackgroundPickerError::CommandExecution(
19 "Empty command".to_owned(),
20 ));
21 }
22 Ok(())
23}