version 1.24, 2020/03/31 17:14:40 |
version 1.25, 2020/04/13 08:26:27 |
|
|
cmd_show_environment_print(struct cmd *self, struct cmdq_item *item, |
cmd_show_environment_print(struct cmd *self, struct cmdq_item *item, |
struct environ_entry *envent) |
struct environ_entry *envent) |
{ |
{ |
struct args *args = self->args; |
struct args *args = cmd_get_args(self); |
char *escaped; |
char *escaped; |
|
|
if (!args_has(args, 'h') && (envent->flags & ENVIRON_HIDDEN)) |
if (!args_has(args, 'h') && (envent->flags & ENVIRON_HIDDEN)) |
|
|
if (args_has(args, 'h') && (~envent->flags & ENVIRON_HIDDEN)) |
if (args_has(args, 'h') && (~envent->flags & ENVIRON_HIDDEN)) |
return; |
return; |
|
|
if (!args_has(self->args, 's')) { |
if (!args_has(args, 's')) { |
if (envent->value != NULL) |
if (envent->value != NULL) |
cmdq_print(item, "%s=%s", envent->name, envent->value); |
cmdq_print(item, "%s=%s", envent->name, envent->value); |
else |
else |
|
|
static enum cmd_retval |
static enum cmd_retval |
cmd_show_environment_exec(struct cmd *self, struct cmdq_item *item) |
cmd_show_environment_exec(struct cmd *self, struct cmdq_item *item) |
{ |
{ |
struct args *args = self->args; |
struct args *args = cmd_get_args(self); |
struct environ *env; |
struct environ *env; |
struct environ_entry *envent; |
struct environ_entry *envent; |
const char *target; |
const char *target; |
|
|
} |
} |
} |
} |
|
|
if (args_has(self->args, 'g')) |
if (args_has(args, 'g')) |
env = global_environ; |
env = global_environ; |
else { |
else { |
if (item->target.s == NULL) { |
if (item->target.s == NULL) { |