diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-03-31 20:01:34 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-03-31 20:01:34 +0100 |
commit | dfd29977e0ab289615eae0b4275763a3082bda24 (patch) | |
tree | 9e1753f4e3748cddfce46356d57044fe7ba49bf0 /cmd-show-environment.c | |
parent | 0bb1a50b88ac319e8f499fa95500f373123594d1 (diff) | |
parent | cc8b41f294974cdfb1ddfe3b907da58374ff130f (diff) | |
download | rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.gz rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.bz2 rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-show-environment.c')
-rw-r--r-- | cmd-show-environment.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd-show-environment.c b/cmd-show-environment.c index eb19cf20..0d2f7dd9 100644 --- a/cmd-show-environment.c +++ b/cmd-show-environment.c @@ -38,8 +38,8 @@ const struct cmd_entry cmd_show_environment_entry = { .name = "show-environment", .alias = "showenv", - .args = { "gst:", 0, 1 }, - .usage = "[-gs] " CMD_TARGET_SESSION_USAGE " [name]", + .args = { "hgst:", 0, 1 }, + .usage = "[-hgs] " CMD_TARGET_SESSION_USAGE " [name]", .target = { 't', CMD_FIND_SESSION, CMD_FIND_CANFAIL }, @@ -69,7 +69,13 @@ static void cmd_show_environment_print(struct cmd *self, struct cmdq_item *item, struct environ_entry *envent) { - char *escaped; + struct args *args = self->args; + char *escaped; + + if (!args_has(args, 'h') && (envent->flags & ENVIRON_HIDDEN)) + return; + if (args_has(args, 'h') && (~envent->flags & ENVIRON_HIDDEN)) + return; if (!args_has(self->args, 's')) { if (envent->value != NULL) |