Skip to main content

TemplateAction

Enum TemplateAction 

Source
pub enum TemplateAction {
    List,
    Show {
        reference: String,
    },
    Create {
        id: String,
        name: Option<String>,
        scope: Option<String>,
        defaults: Vec<String>,
        prompts: Vec<String>,
        references: Vec<String>,
    },
    Update {
        reference: String,
        name: Option<String>,
        scope: Option<String>,
        defaults: Vec<String>,
        prompts: Vec<String>,
        references: Vec<String>,
    },
    Duplicate {
        reference: String,
        id: Option<String>,
        name: Option<String>,
    },
    Delete {
        reference: String,
        yes: bool,
    },
}
Expand description

The tix template management tree (contracts/cli-surface.md).

list/show are read-only; the four mutations call one service that validates the complete candidate registry before a single atomic tix.toml save, so a refused operation leaves the file byte-identical. Identity is the immutable stable ID: update changes a display name without touching scope, defaults, prompts, references, or preserved unknown metadata.

Variants§

§

List

List templates: one id<TAB>name<TAB>scope row each, in declaration order

§

Show

Show one template by stable ID (or a unique display name)

Fields

§reference: String

Stable ID, or a display name that names exactly one template

§

Create

Create a template under a new stable ID

Fields

§id: String

The new stable ID: ASCII letters, digits, - or _

§name: Option<String>

Display name; omitted means the ID is shown in its place

§scope: Option<String>

Scope: repository (default) | board:<name> | team:<label>

§defaults: Vec<String>

A normal create default, FIELD=VALUE (repeatable). Supplying any --default replaces the whole defaults block.

§prompts: Vec<String>

A structured prompt, key=<field>[,kind=text|select|multi-select|date][,required=true|false][,default=<v>][,label=<l>][,options_ref=<source>] (repeatable). Supplying any --prompt replaces the whole prompt list.

§references: Vec<String>

A typed reference, kind=label|assignee|file|cycle|milestone|relationship,value=<v>[,required=true|false] (repeatable). Supplying any --reference replaces the whole list.

§

Update

Update the flags supplied, leaving every other stored field as it was

Fields

§reference: String

Stable ID, or a display name that names exactly one template

§name: Option<String>

New display name (the stable ID never changes)

§scope: Option<String>

New scope: repository | board:<name> | team:<label>

§defaults: Vec<String>

Replacement defaults, FIELD=VALUE (repeatable)

§prompts: Vec<String>

Replacement prompts (repeatable; same grammar as create)

§references: Vec<String>

Replacement references (repeatable; same grammar as create)

§

Duplicate

Copy a template to a new stable ID, leaving the source untouched

Fields

§reference: String

Stable ID, or a display name that names exactly one template

§id: Option<String>

The new stable ID; omitted allocates <source>-copy, -copy-2, …

§name: Option<String>

Display name for the copy; omitted keeps the source’s label

§

Delete

Delete a template definition (never the issues created from it)

Fields

§reference: String

Stable ID, or a display name that names exactly one template

§yes: bool

Confirm without prompting

Trait Implementations§

Source§

impl FromArgMatches for TemplateAction

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 TemplateAction

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> 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, 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.