Ports FileBot's net.filebot.cli flag surface so Aurora Curator can be scripted, not just driven through the GUI. Argument parsing and file-expansion are pure Rust in aurora-curator-core::cli (14 unit tests, no Tauri/network dependency); orchestration lives in src-tauri/src/cli.rs, which reuses the exact same binding vocabulary the GUI's RenamePanel.tsx builds client-side and the exact same TMDB/TVmaze season-caching lookup fetch_metadata already uses, so a naming scheme renders identically whether it's typed into the app or passed via --format. main.rs branches to CLI mode before any Tauri App/window is built at all, using tauri::async_runtime::block_on to drive the async metadata lookups (confirmed safe standalone by reading Tauri's own async_runtime.rs) and a hand-rolled settings::cli_tmdb_token() that replicates Tauri's own app_config_dir() computation (dirs::config_dir().join(identifier), pinned against tauri.conf.json by a new test) so a token saved through the GUI's Fetch Data Settings is found from the CLI path too - the CLI still never accepts a token as an argument. Deliberately not ported: --output <dir> (the rename engine's safety invariant against escaping the source directory tree would need to be relaxed) and -non-strict is accepted as a no-op (local matching has no confidence score to loosen). 16 new tests in src-tauri (10 in cli.rs, 1 pinning settings:: APP_CONFIG_IDENTIFIER) plus 14 in aurora-curator-core's cli module - full workspace suite is 113 passing. README updated with a new "Command-line usage" section and roadmap item 6 marked done for the CLI surface. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QLbx8ov7zMcdDPEqQm4Y98
18 lines
847 B
Rust
18 lines
847 B
Rust
// Prevents an additional console window on Windows in release builds.
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
fn main() {
|
|
// `-rename`/`-h`/`--help` on the command line means this is a scripted CLI
|
|
// invocation, not a normal double-click GUI launch - see
|
|
// `aurora_curator_core::cli`'s module doc. Checked with the exact same predicate
|
|
// `cli::parse_args` itself uses internally, so this can never drift out of sync
|
|
// with what actually triggers CLI mode. No args at all (the normal launch case)
|
|
// falls straight through to the unchanged GUI path below.
|
|
let args: Vec<String> = std::env::args().skip(1).collect();
|
|
if aurora_curator_core::cli::looks_like_cli_invocation(&args) {
|
|
std::process::exit(aurora_curator_lib::run_cli(args));
|
|
}
|
|
|
|
aurora_curator_lib::run();
|
|
}
|