Skip to main content

Arguments

Struct Arguments 

Source
pub struct Arguments {
Show 19 fields pub existing: bool, pub group: bool, pub group_with: Option<String>, pub dont_attach: bool, pub layout: bool, pub path: Option<String>, pub name: Option<String>, pub print_workspace_name: bool, pub command: Option<String>, pub make_default_config: bool, pub make_default_layout_config: bool, pub print_config_schema: bool, pub print_layout_config_schema: bool, pub print_bash_completion: bool, pub print_zsh_completion: bool, pub print_fish_completion: bool, pub print_man: bool, pub search_paths: Option<Vec<String>>, pub depth: Option<usize>,
}
Expand description

twm (tmux workspace manager) is a customizable tool for managing workspaces in tmux sessions.

Workspaces are defined as a directory matching any workspace pattern from your configuration. If no configuration is set, any directory containing a .git file/folder or a .twm.yaml file is considered a workspace.

Environment variables that affect twm:

TWM_CONFIG_FILE: Path to the configuration file to use. Overrides the default search locations.

Environment variables that twm sets in tmux sessions:

TWM: set to 1 to indicate that you’re in a twm-managed session

TWM_ROOT: the root directory of the workspace

TWM_TYPE: the type of workspace, as defined in your configuration via the “name” on workspace definitions

TWM_NAME: the name of the session at creation time

Fields§

§existing: bool

Prompt user to select an existing tmux session to attach to.

This shouldn’t be used with other options.

§group: bool

Prompt user to start a new session in the same group as an existing session.

Setting this option will cause -l/--layout and -p/--path to be ignored.

§group_with: Option<String>

Group with an existing session by name.

§dont_attach: bool

Don’t attach to the workspace session after opening it.

§layout: bool

Prompt user to select a globally-defined layout to open the workspace with.

Using this option will override any other layout definitions that would otherwise automatically be used when opening the workspace.

§path: Option<String>

Open the given path as a workspace.

Using this option does not require that the path be a valid workspace according to your configuration.

§name: Option<String>

Force the workspace to be opened with the given name.

When setting this option, you should be aware that twm will not “see” this session when performing other automatic actions. For example, if you have a workspace at ~/foobar and run twm -n jimbob -p ~/foobar, and then run twm and select ~/foobar from the picker, a new session foobar will be created. If you then run twm -g and select foobar, foobar-1 will be created in the foobar group.

§print_workspace_name: bool

Print the name of the workspace generated for the given path to stdout.

This can be used with other options.

§command: Option<String>

Override any layouts and open the workspace with the given command instead.

§make_default_config: bool

Make default configuration file.

By default will attempt to write a default configuration file and configuration schema in $XDG_CONFIG_HOME/twm/ Using -p/--path with this flag will attempt to write the files to the folder specified. twm will not overwrite existing files. You will be prompted to rename/move the existing files before retrying.

§make_default_layout_config: bool

Make default local layout configuration file.

Will attempt to create .twm.yaml in the current directory. Will not overwrite existing files. You can use -p/--path <PATH> to specify a different directory to write the file to.

§print_config_schema: bool

Print the configuration file (twm.yaml) schema.

This can be used with tools (e.g. language servers) to provide autocompletion and validation when editing your configuration.

§print_layout_config_schema: bool

Print the local layout configuration file (.twm.yaml) schema.

This can be used with tools (e.g. language servers) to provide autocompletion and validation when editing your configuration.

§print_bash_completion: bool

Print bash completions to stdout

§print_zsh_completion: bool

Print zsh completions to stdout

§print_fish_completion: bool

Print fish completions to stdout

§print_man: bool

Print man(1) page to stdout

§search_paths: Option<Vec<String>>

Paths to search for workspaces in. Overrides paths set in configuration.

Multiple paths can be specified by setting this flag multiple times, e.g. -s ~/projects -s ~/work.

§depth: Option<usize>

Maximum depth to search for workspaces. Overrides max depth set in configuration.

Trait Implementations§

Source§

impl Args for Arguments

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

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

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

fn augment_args_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§

impl CommandFactory for Arguments

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Arguments

Source§

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

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

impl Default for Arguments

Source§

fn default() -> Arguments

Returns the “default value” for a type. Read more
Source§

impl FromArgMatches for Arguments

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( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Arguments

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.