Enum Command

Source
pub enum Command {
    Resume {
        create: bool,
    },
    Start {
        name: Option<String>,
        program: Option<String>,
        args: Vec<String>,
        detached: bool,
    },
    Attach {
        session: SessionSelector,
        create: bool,
    },
    Select,
    Detach {
        session: Option<SessionSelector>,
    },
    Kill {
        session: SessionSelector,
    },
    List {
        info: bool,
        json: bool,
    },
    Shutdown,
}

Variants§

§

Resume

Resume the last used session [alias: r]

Specify –create / -c to create a new session if one does not exist

Fields

§create: bool

Create a new session if one does not exist

§

Start

Start a new session, optionally specifying a name [alias: s]

If no program is specified, the default shell will be used. If no name is specified, the name will be [program name]-[n-1] where n is the number of sessions with that program name. If –detached / -d is present, the session will not be attached to the client on creation and will run in the background.

Fields

§program: Option<String>
§args: Vec<String>
§detached: bool
§

Attach

Attach to a session [alias: a]

Select a session by index or name. If –create / -c is present, a new session will be created if one does not exist. If the session was selected by name and the session was not present, the new session created by –create will have the specified name.

Fields

§session: SessionSelector

Id or name of session

§create: bool

Create a new session if one does not exist

§

Select

Fuzzy select a session to attach to [alias: f]

Opens a fuzzy selection window provided by the dialoguer crate. Type to fuzzy find files, or use the Up/Down arrows to navigate. Press Enter to confirm your selection, or Escape to cancel.

§

Detach

Detach from a session [alias: d]

If no session is specified, detaches from the current session (if it exists). Otherwise, detaches the specified session from its owning client.

Fields

§session: Option<SessionSelector>

Id or name of session

§

Kill

Kill a session [alias: k]

Kills a session and the process it owns. Select a session by name or index.

Fields

§session: SessionSelector

Id or name of session

§

List

List sessions [alias: ls]

Prints a compact list of session names and indexes. With the –info / -i option, prints a nicely formatted table with info about each session.

Fields

§info: bool

Print detailed info about sessions

§json: bool

Print session info as JSON, to be processed by another tool

§

Shutdown

Shutdown the server (kill all sessions)

Trait Implementations§

Source§

impl Debug for Command

Source§

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

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

impl FromArgMatches for Command

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 Command

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.