diff options
Diffstat (limited to 'cmd-show-environment.c')
-rw-r--r-- | cmd-show-environment.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/cmd-show-environment.c b/cmd-show-environment.c index 6d0f364c..f52efbca 100644 --- a/cmd-show-environment.c +++ b/cmd-show-environment.c @@ -31,27 +31,26 @@ int cmd_show_environment_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_show_environment_entry = { "show-environment", "showenv", + "gt:", 0, 0, "[-g] " CMD_TARGET_SESSION_USAGE, - 0, "g", - cmd_target_init, - cmd_target_parse, - cmd_show_environment_exec, - cmd_target_free, - cmd_target_print + 0, + NULL, + NULL, + cmd_show_environment_exec }; int cmd_show_environment_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_target_data *data = self->data; - struct session *s; - struct environ *env; - struct environ_entry *envent; + struct args *args = self->args; + struct session *s; + struct environ *env; + struct environ_entry *envent; - if (cmd_check_flag(data->chflags, 'g')) + if (args_has(self->args, 'g')) env = &global_environ; else { - if ((s = cmd_find_session(ctx, data->target)) == NULL) + if ((s = cmd_find_session(ctx, args_get(args, 't'))) == NULL) return (-1); env = &s->environ; } |