Expand description
Oxur CLI library and binary
This crate provides two things:
-
Library: Common utilities for building Oxur CLI tools
- File I/O helpers (stdin/stdout/file handling)
- Colored terminal output (success, error, info, warnings)
- Progress tracking for long-running operations
-
Binary: The unified
oxurcommand-line tool
§Library Usage
Add to your CLI’s Cargo.toml:
[dependencies]
oxur-cli = { path = "../oxur-cli" }§Basic I/O
use oxur_cli::common::io::{read_input, write_output};
use std::path::PathBuf;
// Read from file or stdin
let content = read_input(&PathBuf::from("input.txt"))?;
// Write to file or stdout
write_output(&content, Some(&PathBuf::from("output.txt")))?;§Colored Output
use oxur_cli::common::output::{success, error, info};
success("Operation completed!");
error("Something went wrong");
info("Processing files...");§Progress Tracking
use oxur_cli::common::progress::ProgressTracker;
let mut progress = ProgressTracker::new(true);
progress.step("Loading data");
// ... do work ...
progress.done();
progress.step("Processing data");
// ... do work ...
progress.done();
progress.success("All done!");Re-exports§
pub use common::progress::ProgressTracker;pub use config::EditMode;pub use config::HistoryConfig;pub use config::ReplConfig;pub use config::TerminalConfig;pub use args::ReplArgs;