My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities.
1use clap::{Parser, Subcommand};
2
3use crate::config::{get_config_dir, get_data_dir};
4
5mod process;
6
7#[derive(Parser, Debug)]
8#[command(author, version = version(), about)]
9pub struct Cli {
10 /// Tick rate, i.e. number of ticks per second
11 #[arg(short, long, value_name = "FLOAT", default_value_t = 4.0)]
12 pub tick_rate: f64,
13
14 /// Frame rate, i.e. number of frames per second
15 #[arg(short, long, value_name = "FLOAT", default_value_t = 60.0)]
16 pub frame_rate: f64,
17
18 #[command(subcommand)]
19 pub command: Option<Commands>,
20}
21
22#[derive(Subcommand, Debug)]
23pub enum Commands {
24 // / Manage TARS groups.
25 // #[command(subcommand)]
26 // Group(GroupSubcommand),
27
28 // / Manage TARS tasks.
29 // #[command(subcommand)]
30 // Task(TaskSubcommand),
31 //
32 //
33 /// Initalize Filaments.
34 ///
35 /// This will write a default config to ~/.config/filaments,
36 /// as well as creating a new "notebook" in the current
37 /// directory with the specified name. Note that we currently
38 /// only support one notebook.
39 Init {
40 #[arg(default_value = "ZettelKasten")]
41 name: String,
42 },
43 // NOTE: By default the importer will fill in fields with
44 // default values if they arent present / aren't able to be
45 // parsed properly
46 // Import(ImportArgs),
47}
48
49// #[derive(Subcommand, Debug)]
50// /// Subcommand to manage tars groups.
51// pub enum GroupSubcommand {
52// /// Add a group.
53// Add(GroupAddArgs),
54// /// List groups.
55// List(GroupListArgs),
56// }
57
58// #[derive(Debug, Args)]
59// pub struct ExportArgs {
60// #[arg(short, long, default_value = "./tars.json")]
61// /// The file-path for data to pe put into.
62// pub out_file: PathBuf,
63// }
64
65const VERSION_MESSAGE: &str = concat!(
66 env!("CARGO_PKG_VERSION"),
67 "-",
68 env!("VERGEN_GIT_DESCRIBE"),
69 " (",
70 env!("VERGEN_BUILD_DATE"),
71 ")"
72);
73
74pub fn version() -> String {
75 let author = clap::crate_authors!();
76
77 // let current_exe_path = PathBuf::from(clap::crate_name!()).display().to_string();
78 let config_dir_path = get_config_dir().display().to_string();
79 let data_dir_path = get_data_dir().display().to_string();
80
81 format!(
82 "\
83{VERSION_MESSAGE}
84
85Authors: {author}
86
87Config directory: {config_dir_path}
88Data directory: {data_dir_path}"
89 )
90}