* Print the current definition of one, or more, or all
* environment variables
*/
-int fw_printenv (int argc, char *argv[])
+int fw_printenv(int argc, char *argv[], int value_only)
{
char *env, *nxt;
int i, rc = 0;
return 0;
}
- if (printenv_args.name_suppress && argc != 1) {
+ if (value_only && argc != 1) {
fprintf(stderr,
"## Error: `-n' option requires exactly one argument\n");
return -1;
}
val = envmatch (name, env);
if (val) {
- if (!printenv_args.name_suppress) {
+ if (!value_only) {
fputs (name, stdout);
putc ('=', stdout);
}
extern struct common_args common_args;
struct printenv_args {
- int name_suppress;
+ int value_only;
};
extern struct printenv_args printenv_args;
int parse_aes_key(char *key, uint8_t *bin_key);
-int fw_printenv(int argc, char *argv[]);
+int fw_printenv(int argc, char *argv[], int value_only);
char *fw_getenv(char *name);
int fw_setenv(int argc, char *argv[]);
int fw_parse_script(char *fname);
EOF) {
switch (c) {
case 'n':
- printenv_args.name_suppress = 1;
+ printenv_args.value_only = 1;
break;
case 'a':
case 'c':
}
if (do_printenv) {
- if (fw_printenv(argc, argv) != 0)
+ if (fw_printenv(argc, argv, printenv_args.value_only))
retval = EXIT_FAILURE;
} else {
if (!setenv_args.script_file) {