diff options
author | Joursoir <chat@joursoir.net> | 2021-02-26 13:07:57 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-02-26 13:07:57 +0000 |
commit | e6f8a3570b63724091c4cec78db609ad65963d65 (patch) | |
tree | 608b8a7e3cf61a226ec67db3911397319812b805 /src/main.c | |
parent | 9824208d05a2ba476cbb3f583fa2df3080a00967 (diff) | |
download | lock-password-e6f8a3570b63724091c4cec78db609ad65963d65.tar.gz lock-password-e6f8a3570b63724091c4cec78db609ad65963d65.tar.bz2 lock-password-e6f8a3570b63724091c4cec78db609ad65963d65.zip |
create own function: tree
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -20,6 +20,7 @@ #include "handerror.h" #include "implementation.h" #include "exec-cmd.h" +#include "tree.h" enum constants { maxlen_texteditor = 16, @@ -35,7 +36,6 @@ enum constants { #define LOCKPASS_DIR ".lock-password/" #define GPGKEY_FILE ".gpg-key" -#define TREE_OUTPUT_FILE ".tree" #define TEXTEDITOR_FILE ".text-editor" #define usageprint(...) \ @@ -500,19 +500,9 @@ int cmd_showtree(int argc, char *argv[]) if(flag_copy) errprint("You must type a passname, not a directory\n"); - char *arg1[] = {"tree", "-C", "--noreport", path, "-o", TREE_OUTPUT_FILE, NULL}; - easyFork("tree", arg1); - - char *arg2[] = {"sed", "-i", "-E", "s/\\.gpg(\\x1B\\[[0-9]+m)?( ->|$)/\\1\\2/g", TREE_OUTPUT_FILE, NULL}; - easyFork("sed", arg2); // remove .gpg at the pass name - if(strcmp(path, ".") == 0) printf("Password Manager\n"); else printf("Password Manager/%s\n", path); - - char *arg3[] = {"tail", "-n", "+2", TREE_OUTPUT_FILE, NULL}; - easyFork("tail", arg3); // remove working directory from output - - remove(TREE_OUTPUT_FILE); + tree(path, ""); } else { |