javelin_tui/
lib.rs

1pub mod datasets;
2pub mod display;
3pub mod functions;
4
5#[cfg(test)]
6mod tests;
7
8use std::sync::Once;
9
10static INIT: Once = Once::new();
11
12pub fn init() {
13    INIT.call_once(|| {
14        // Read RUST_LOG env variable, default to "info" if not set
15        let env = env_logger::Env::default().default_filter_or("info");
16
17        // don't panic if called multiple times across binaries
18        let _ = env_logger::Builder::from_env(env).try_init();
19    });
20}
21
22use clap::{Parser, Subcommand};
23use std::path::PathBuf;
24
25#[derive(Parser)]
26#[command(name = "javelin", about = "Display and work with Lance matrices")]
27pub struct Cli {
28    /// Path to a lance file or directory
29    #[arg(long)]
30    pub filepath: Option<PathBuf>,
31    #[command(subcommand)]
32    pub cmd: Option<Command>,
33}
34
35#[derive(Subcommand)]
36pub enum Command {
37    Tui,
38    Info,
39    Head {
40        n: usize,
41    },
42    Sample {
43        n: usize,
44    },
45    Stats,
46    Display,
47    Generate {
48        #[arg(long, default_value = "200")]
49        n_items: usize,
50        #[arg(long, default_value = "300")]
51        n_dims: usize,
52        #[arg(long, default_value = "42")]
53        seed: u64,
54    },
55}