use clap::{Parser, Subcommand};
use crate::data::status::DevLogEntryStatus;
#[derive(Debug, Parser)]
#[command(
name = "devlog",
version = version_text(),
long_version = version_text(),
about = "A tiny developer journal for the terminal"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
Add {
message: String,
},
List,
SetStatus {
id: String,
#[arg(value_enum)]
status: DevLogEntryStatus,
},
}
fn version_text() -> &'static str {
concat!(
"v",
env!("CARGO_PKG_VERSION"),
"\n",
"Author: ",
env!("CARGO_PKG_AUTHORS"),
"\n",
"Repository: ",
env!("CARGO_PKG_REPOSITORY")
)
}