pub enum TimeCommand {
Add {
issue: String,
minutes: i64,
date: Option<String>,
author: String,
note: Option<String>,
},
Edit {
issue: String,
entry: String,
change: TimeEditArgs,
},
Delete {
issue: String,
entry: String,
reason: Option<String>,
confirm: bool,
},
Show {
issue: String,
},
History {
issue: String,
},
Total {
selector: Option<String>,
filter: TimeTotalArgs,
},
}Expand description
The tix time subcommands (mission per-issue-time-tracking-01M3C9A4, WP04).
A thin adapter: the entry model and its validation, the mutation service and its
append-only History, and every filter, total and finding live under
crate::time_tracking. This enum owns only the spelling of the surface — the
duration is whole minutes, a date is a calendar YYYY-MM-DD, and there is no flag
here that could express a timer, a timezone, an overlap rule or a billing unit
(C-002/C-009).
Variants§
Add
Record effort against an issue, in whole minutes
The date is optional and is a calendar date, never an instant: an entry without one is real, and a period-bounded read reports it as undated rather than as zero.
Fields
minutes: i64The effort, in whole minutes at or above zero
A negative value is accepted by the parser and refused by the shared entry validator with its field name, which is a better message than clap’s “unexpected argument”.
Who did the work: a handle (ada, @ada) or a Name <email> identity
Edit
Correct one entry, naming only the fields that change
A field the command does not name is left exactly as it was, including the entry’s
date, note and any metadata another build attached. --clear-date and
--clear-note are how an optional value is removed (an empty --note "" would be
a value, not an absence). A correction requires --reason: the prior value stays
in History, and the reason is what makes the change attributable.
Fields
change: TimeEditArgsDelete
Remove one entry from the issue’s current entries
The entry leaves the frontmatter; its value and its event stay in History, so a
deletion is auditable rather than a rewrite. Requires --reason and --confirm.
Fields
Show
Show an issue’s current entries and its total
History
Show what History retains for an issue: current entries beside its audit
Total
Total recorded effort, by issue, assignee and calendar period
Every value comes from the shared calculation; a scope with nothing to total and a
scope whose entries carry no usable duration print - with their state, never a
zero. Deleted entries are excluded unless --audit asks for them.
Fields
selector: Option<String>Issue number, filename fragment or unique title fragment (alternative to --issue)
filter: TimeTotalArgsTrait Implementations§
Source§impl Clone for TimeCommand
impl Clone for TimeCommand
Source§impl Debug for TimeCommand
impl Debug for TimeCommand
Source§impl FromArgMatches for TimeCommand
impl FromArgMatches for TimeCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for TimeCommand
impl Subcommand for TimeCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for TimeCommand
impl RefUnwindSafe for TimeCommand
impl Send for TimeCommand
impl Sync for TimeCommand
impl Unpin for TimeCommand
impl UnsafeUnpin for TimeCommand
impl UnwindSafe for TimeCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more