renamed detach flag and added detach support to 'new'
This commit is contained in:
parent
782fb694d0
commit
aa4c26ba4c
2 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,7 @@ pub fn attach(pargs: &mut Arguments) {
|
|||
|
||||
// consume optional flags
|
||||
let read_only = pargs.contains(flag::READ_ONLY);
|
||||
let detach_other = pargs.contains(flag::DETACHED);
|
||||
let detach_other = pargs.contains(flag::DETACH);
|
||||
|
||||
let args = pargs.clone().finish();
|
||||
let target: String;
|
||||
|
@ -146,6 +146,7 @@ pub fn new(pargs: &mut Arguments) {
|
|||
util::prevent_nest();
|
||||
|
||||
// get optional flag
|
||||
let detached = pargs.contains(flag::DETACH);
|
||||
let target_dir: Result<String, Error> = pargs.value_from_str(flag::TARGET);
|
||||
|
||||
// get target or fallback
|
||||
|
@ -164,6 +165,7 @@ pub fn new(pargs: &mut Arguments) {
|
|||
let mut new = commands::NewSession::new();
|
||||
new = new.group_name(title);
|
||||
if let Some(command) = command { new.shell_command = Some(command.to_string_lossy()); }
|
||||
if detached { new.detached = true; }
|
||||
if let Ok(target_dir) = target_dir { new = new.start_directory(target_dir); }
|
||||
|
||||
Tmux::new()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
type Flag = [&'static str;2];
|
||||
|
||||
pub static DETACHED: Flag = ["-d", "--detached"];
|
||||
pub static DETACH: Flag = ["-d", "--detach"];
|
||||
pub static HELP: Flag = ["-h", "--help"];
|
||||
pub static NEST: Flag = ["-n", "--nest"];
|
||||
pub static QUIET: Flag = ["-q", "--quiet"];
|
||||
|
|
Loading…
Reference in a new issue