Skip to content

Commit

Permalink
Deprecate the open command
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertAudi committed Mar 31, 2019
1 parent b104f0e commit 1a24f86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
15 changes: 5 additions & 10 deletions dist/bin/tsm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ __tsm_commands=(
rename "Rename a saved session"
copy "Copy a saved session"
restore "Restore a saved session"
resume,open "Restore and attach a saved session"
resume "Restore and attach a saved session"
quit "Quit tmux"
version "Show version"
help "Show usage information"
Expand Down Expand Up @@ -595,15 +595,6 @@ Help-Message
function __tsm::commands::help::resume() {
cat <<Help-Message
Usage: tsm resume <name>
Aliased as: open
Help-Message
return 64
}

function __tsm::commands::help::open() {
cat <<Help-Message
Usage: tsm open <name>
Alias of: resume
Help-Message
return 64
}
Expand Down Expand Up @@ -668,6 +659,10 @@ function __tsm::commands::list() {
# Restore a session and attach to one
# Alias of: __tsm::commands::resume
function __tsm::commands::open() {
__tsm::utils::log warn \
"The $(__tsm::utils::colorize warn "open") command" \
"is $(__tsm::utils::colorize bold,underline "DEPRECATED")," \
"use the $(__tsm::utils::colorize info "reusme") command instead."
__tsm::commands::resume "$@"
}

Expand Down
9 changes: 0 additions & 9 deletions src/commands/help.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ Help-Message
function __tsm::commands::help::resume() {
cat <<Help-Message
Usage: tsm resume <name>
Aliased as: open
Help-Message
return 64
}

function __tsm::commands::help::open() {
cat <<Help-Message
Usage: tsm open <name>
Alias of: resume
Help-Message
return 64
}
Expand Down
4 changes: 4 additions & 0 deletions src/commands/open.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Restore a session and attach to one
# Alias of: __tsm::commands::resume
function __tsm::commands::open() {
__tsm::utils::log warn \
"The $(__tsm::utils::colorize warn "open") command" \
"is $(__tsm::utils::colorize bold,underline "DEPRECATED")," \
"use the $(__tsm::utils::colorize info "reusme") command instead."
__tsm::commands::resume "$@"
}
2 changes: 1 addition & 1 deletion src/core/constants.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ __tsm_commands=(
rename "Rename a saved session"
copy "Copy a saved session"
restore "Restore a saved session"
resume,open "Restore and attach a saved session"
resume "Restore and attach a saved session"
quit "Quit tmux"
version "Show version"
help "Show usage information"
Expand Down

0 comments on commit 1a24f86

Please sign in to comment.