WIP start adding ent binary
This commit is contained in:
parent
561f85fbb0
commit
53c5d03ab7
2 changed files with 38 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
anyhow = "1.0.95"
|
||||||
|
clap = { version = "4.5.26", features = ["derive"] }
|
||||||
serde = { version = "1.0.217", features = ["derive"] }
|
serde = { version = "1.0.217", features = ["derive"] }
|
||||||
thiserror = "2.0.11"
|
thiserror = "2.0.11"
|
||||||
toml = "0.8.19"
|
toml = "0.8.19"
|
||||||
|
|
|
||||||
36
src/bin/ent/main.rs
Normal file
36
src/bin/ent/main.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
use clap::Parser;
|
||||||
|
|
||||||
|
#[derive(Debug, clap::Parser)]
|
||||||
|
#[command(version, about, long_about = None)]
|
||||||
|
struct Args {
|
||||||
|
/// Directory containing issues.
|
||||||
|
#[arg(short, long)]
|
||||||
|
issues_dir: String,
|
||||||
|
|
||||||
|
/// Type of behavior/output.
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: Commands,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(clap::Subcommand, Debug)]
|
||||||
|
enum Commands {
|
||||||
|
/// List issues.
|
||||||
|
List,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() -> anyhow::Result<()> {
|
||||||
|
let args: Args = Args::parse();
|
||||||
|
// println!("{:?}", args);
|
||||||
|
|
||||||
|
match args.command {
|
||||||
|
Commands::List => {
|
||||||
|
let issues =
|
||||||
|
entomologist::issues::Issues::new_from_dir(std::path::Path::new(&args.issues_dir))?;
|
||||||
|
for (uuid, issue) in issues.issues.iter() {
|
||||||
|
println!("{} {} ({:?})", uuid, issue.title, issue.state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue