aboutsummaryrefslogtreecommitdiff
path: root/apps/cassiopeia/src/bin
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-19 15:15:20 +0000
committerMx Kookie <kookie@spacekookie.de>2020-12-21 05:19:49 +0100
commit69eaad1c9f934bccaf7e28529a6b1657345f0184 (patch)
tree4e7517a16f7303f5f6efbd02e4aae85bdc5aec29 /apps/cassiopeia/src/bin
parentb9c988f42504c2e4cfa0715ac8f2d2a0db591cad (diff)
cassiopeia: changing internal data representation to timeline module
What this allows us to do is much better relationship tracking between sessions and invoices. The CASS file already has all the structure we need, and it would be silly to replicate it via complicated time association algorithms. This approach uses the linear nature of the data file to track the position relative to other entries. The timeline module is then responsible for making changes to the internal representation (in case it is being used as a library for multi-query commands), and emitting a `Delta` type that can be used to easily patch the IR in question, because the mapping between the timeline and IR representations is linear.
Diffstat (limited to 'apps/cassiopeia/src/bin')
-rw-r--r--apps/cassiopeia/src/bin/cass.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/cassiopeia/src/bin/cass.rs b/apps/cassiopeia/src/bin/cass.rs
index 90f84661ae0c..8bceddc911a4 100644
--- a/apps/cassiopeia/src/bin/cass.rs
+++ b/apps/cassiopeia/src/bin/cass.rs
@@ -64,6 +64,7 @@ If you want to report a bug, please do so on my mailing list: lists.sr.ht/~space
.help(meta::ARG_CLIENT_DB_ABOUT),
)
)
+ .subcommand(SubCommand::with_name(meta::CMD_STAT).about(meta::CMD_STAT_ABOUT))
.get_matches();
let cass_file = cli.value_of(meta::ARG_FILE).unwrap();
@@ -119,6 +120,13 @@ If you want to report a bug, please do so on my mailing list: lists.sr.ht/~space
std::process::exit(1);
}
},
+ (meta::CMD_STAT, _) => match cass.stat() {
+ Some(s) => println!("{}", s),
+ None => {
+ eprintln!("Failed to collect time statistics...");
+ std::process::exit(1);
+ }
+ },
(_, _) => todo!(),
}
}