Enum sesh_cli::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

Fields

§create: bool

Create a new session if one does not exist

Resume the last used session [alias: r]

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

§

Start

Fields

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

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.

§

Attach

Fields

§session: SessionSelector

Id or name of session

§create: bool

Create a new session if one does not exist

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.

§

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

Fields

§session: Option<SessionSelector>

Id or name of session

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.

§

Kill

Fields

§session: SessionSelector

Id or name of session

Kill a session [alias: k]

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

§

List

Fields

§info: bool

Print detailed info about sessions

§json: bool

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

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.

§

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. Read more
source§

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

Append to [Command] so it can update self. 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.