aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-06-11 20:27:50 +0000
committerJoursoir <chat@joursoir.net>2021-06-11 20:27:50 +0000
commitad30c1a528d93566db72a058cda1992e986210c0 (patch)
tree0838976b62639fff29765d68d013e6c76c9854b5 /src
parente41782a1af7c1217589a6c0f3580c8fb955a8c71 (diff)
downloadlock-password-ad30c1a528d93566db72a058cda1992e986210c0.tar.gz
lock-password-ad30c1a528d93566db72a058cda1992e986210c0.tar.bz2
lock-password-ad30c1a528d93566db72a058cda1992e986210c0.zip
exec-cmd: show: handle argument '--no-color'
Diffstat (limited to 'src')
-rw-r--r--src/exec-cmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exec-cmd.c b/src/exec-cmd.c
index 4ec1c10..0751d29 100644
--- a/src/exec-cmd.c
+++ b/src/exec-cmd.c
@@ -424,18 +424,20 @@ int cmd_version(int argc, char *argv[])
int cmd_showtree(int argc, char *argv[])
{
- const char description[] = "[-c] [passname]\n";
- int flag_copy = 0;
+ const char description[] = "[-cC] [passname]\n";
+ int flag_copy = 0, flag_color = 1;
int retval = 0, result;
char *path;
const struct option long_options[] = {
{"copy", no_argument, NULL, 'c'},
+ {"no-color", no_argument, NULL, 'C'},
{NULL, 0, NULL, 0}
};
- while((result = getopt_long(argc, argv, "c", long_options, NULL)) != -1) {
+ while((result = getopt_long(argc, argv, "cC", long_options, NULL)) != -1) {
switch(result) {
case 'c': { flag_copy = 1; break; }
+ case 'C': { flag_color = 0; break; }
default: usageprint("%s", description);
}
}
@@ -467,7 +469,7 @@ int cmd_showtree(int argc, char *argv[])
printf("Password Manager\n");
else
printf("Password Manager/%s\n", path);
- tree(path, "");
+ tree(path, "", flag_color);
}
else if(result == F_ISFILE)
{