Skip to main content

TimeCommand

Enum TimeCommand 

Source
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

§issue: String

Issue number, filename fragment or unique title fragment

§minutes: i64

The 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”.

§date: Option<String>

The calendar date the effort belongs to, YYYY-MM-DD

§author: String

Who did the work: a handle (ada, @ada) or a Name <email> identity

§note: Option<String>

Free-text context, preserved verbatim

§

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

§issue: String

Issue number, filename fragment or unique title fragment

§entry: String

The stable id of the entry to correct (tix time show <ISSUE> lists them)

§

Delete

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

§issue: String

Issue number, filename fragment or unique title fragment

§entry: String

The stable id of the entry to remove

§reason: Option<String>

Why the entry is being removed; recorded in History

§confirm: bool

Confirm the removal without prompting

§

Show

Show an issue’s current entries and its total

Fields

§issue: String

Issue number, filename fragment or unique title fragment

§

History

Show what History retains for an issue: current entries beside its audit

Fields

§issue: String

Issue number, filename fragment or unique title fragment

§

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)

Trait Implementations§

Source§

impl Clone for TimeCommand

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TimeCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for TimeCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for TimeCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.