mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
added option -y which allows to export the whole vault as yaml.
This commit is contained in:
11
src/pcp.c
11
src/pcp.c
@@ -82,6 +82,7 @@ int main (int argc, char **argv) {
|
||||
{ "import-public", no_argument, NULL, 'P' },
|
||||
{ "remove-key", no_argument, NULL, 'R' },
|
||||
{ "edit-key", no_argument, NULL, 'E' },
|
||||
{ "export-yaml", no_argument, NULL, 'y' },
|
||||
|
||||
// crypto
|
||||
{ "encrypt", no_argument, NULL, 'e' },
|
||||
@@ -102,7 +103,7 @@ int main (int argc, char **argv) {
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "klV:vdehsO:i:I:pSPRtEx:DzZr:gc:",
|
||||
while ((opt = getopt_long(argc, argv, "klV:vdehsO:i:I:pSPRtEx:DzZr:gc:y",
|
||||
longopts, NULL)) != -1) {
|
||||
|
||||
switch (opt) {
|
||||
@@ -175,6 +176,10 @@ int main (int argc, char **argv) {
|
||||
strncpy(sigfile, optarg, strlen(optarg)+1);
|
||||
usevault = 1;
|
||||
break;
|
||||
case 'y':
|
||||
mode += PCP_MODE_YAML;
|
||||
usevault = 1;
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
strncpy(vaultfile, optarg, 1024);
|
||||
@@ -377,7 +382,9 @@ int main (int argc, char **argv) {
|
||||
pcpverify(infile, sigfile);
|
||||
break;
|
||||
|
||||
|
||||
case PCP_MODE_YAML:
|
||||
pcpexport_yaml(outfile);
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user