Open mclang opened 2 months ago
Enum CliGetWhat
:
/// Get latest COUNT worktime BREAK/LOGIN/LOGOUT punch lines
Latest {
/// Number of punch lines to get
#[arg(value_name = "count")]
cnt: u32,
/// Punch type to get. (default: all types)
#[arg(value_enum, value_name="type")]
typ: Option<PunchType>,
},
Function get_latest_punch(api_key: String, punch_type: Option<PunchType>, punch_count: u32)
Main function match &CLIARGS.command
:
CliGetWhat::Latest { cnt, typ } => get_latest_punch(config.api_key, *typ, *cnt),
Problem
Many times it would be nice to be able see what has happened today instead of e.g latest 15 punch lines.
Solution
Change
get_latest_punch
function to accept also today (and maybe yesterday also?) and print only punch lines done today.