2026-08-02 19:04:30 -04:00
|
|
|
//! `quicksearch-cli <query>` — terminal search, and nothing else.
|
|
|
|
|
//!
|
|
|
|
|
//! A console-subsystem binary, so redirection, pipes, exit codes, and the
|
|
|
|
|
//! shell waiting for the process all behave normally. `src/cli.rs` and
|
2026-08-09 16:25:43 -04:00
|
|
|
//! `src/format.rs` are compiled into both binaries.
|
2026-08-02 19:04:30 -04:00
|
|
|
|
2026-08-25 01:04:36 -04:00
|
|
|
// Per-binary, like the GUI's; see `platform::Allocator`.
|
|
|
|
|
#[global_allocator]
|
|
|
|
|
static GLOBAL: quicksearch_core::platform::Allocator = quicksearch_core::platform::Allocator;
|
|
|
|
|
|
2026-08-02 19:04:30 -04:00
|
|
|
mod cli;
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
mod format;
|
2026-08-02 20:21:19 -04:00
|
|
|
#[allow(dead_code)]
|
|
|
|
|
mod keychain;
|
2026-08-04 23:33:28 -04:00
|
|
|
#[allow(dead_code)]
|
|
|
|
|
mod version;
|
2026-08-02 19:04:30 -04:00
|
|
|
|
|
|
|
|
fn main() {
|
2026-08-09 16:25:43 -04:00
|
|
|
// `None` means "no query given"; this binary has no GUI to fall back to.
|
2026-08-02 19:04:30 -04:00
|
|
|
let code = cli::maybe_run_cli().unwrap_or_else(|| {
|
|
|
|
|
eprintln!("{}", cli::USAGE);
|
|
|
|
|
2
|
|
|
|
|
});
|
|
|
|
|
std::process::exit(code);
|
|
|
|
|
}
|