summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-08-21 18:01:40 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-08-21 18:01:40 +0100
commita36da3a878a76f9570bee1b180a07243df4d382c (patch)
tree70971e476db6ec799abfc9ffa73ca0692aedcc43 /cmd-new-session.c
parent23519fc0b440ccfe13d52ab3e09ea98c792d4fa7 (diff)
Remove the barely-used and unnecessary command check() function.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 4eebe632..b1e1aa45 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -30,7 +30,6 @@
* Create a new session and attach to the current terminal unless -d is given.
*/
-enum cmd_retval cmd_new_session_check(struct args *);
enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_session_entry = {
@@ -40,19 +39,10 @@ const struct cmd_entry cmd_new_session_entry = {
CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]",
CMD_STARTSERVER|CMD_CANTNEST|CMD_SENDENVIRON,
NULL,
- cmd_new_session_check,
cmd_new_session_exec
};
enum cmd_retval
-cmd_new_session_check(struct args *args)
-{
- if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n')))
- return (CMD_RETURN_ERROR);
- return (CMD_RETURN_NORMAL);
-}
-
-enum cmd_retval
cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
@@ -70,6 +60,11 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
int already_attached;
struct format_tree *ft;
+ if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n'))) {
+ cmdq_error(cmdq, "command or window name given with target");
+ return (CMD_RETURN_ERROR);
+ }
+
newname = args_get(args, 's');
if (newname != NULL) {
if (!session_check_name(newname)) {