diff options
author | midipix <writeonce@midipix.org> | 2025-06-11 06:06:51 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2025-06-11 06:08:05 +0000 |
commit | 2115d01c6543b2ab46b0205287882fc4704d1832 (patch) | |
tree | 89c1330bc9b26796316cee527544391c65f24242 /src | |
parent | 0044bcd283400d4e68b340d9d5aac62f775e677d (diff) | |
download | perk-2115d01c6543b2ab46b0205287882fc4704d1832.tar.bz2 perk-2115d01c6543b2ab46b0205287882fc4704d1832.tar.xz |
driver: added the --yaml switch (same as --pretty=yaml).
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/pe_driver_ctx.c | 8 | ||||
-rw-r--r-- | src/internal/perk_driver_impl.h | 1 | ||||
-rw-r--r-- | src/skin/pe_skin_perk.c | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 5e2f8ee..279527d 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -191,6 +191,7 @@ static int pe_cctx_update( const char * cmdarg) { struct argv_entry * entry; + struct argv_entry * fmtarg; const char * pretty; pretty = 0; @@ -221,6 +222,10 @@ static int pe_cctx_update( cctx->drvflags |= PERK_DRIVER_VERSION; break; + case TAG_YAML: + fmtarg = entry; + break; + case TAG_PRETTY: pretty = entry->arg; break; @@ -327,6 +332,9 @@ static int pe_cctx_update( } else if (pretty && !strcmp(pretty,"dlltool")) { cctx->fmtflags |= PERK_PRETTY_DLLTOOL; + + } else if (fmtarg && (fmtarg->tag == TAG_YAML)) { + cctx->fmtflags |= PERK_PRETTY_YAML; } return 0; diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h index 22e7894..5cd0d73 100644 --- a/src/internal/perk_driver_impl.h +++ b/src/internal/perk_driver_impl.h @@ -20,6 +20,7 @@ enum app_tags { TAG_HELP, TAG_VERSION, TAG_CMD, + TAG_YAML, TAG_PRETTY, TAG_VERBOSE, TAG_CATEGORY, diff --git a/src/skin/pe_skin_perk.c b/src/skin/pe_skin_perk.c index 6a96c6b..3678341 100644 --- a/src/skin/pe_skin_perk.c +++ b/src/skin/pe_skin_perk.c @@ -54,5 +54,9 @@ const perk_hidden struct argv_option pe_perk_options[] = { "either all headers (the default) " "or a specific header"}, + {"yaml", 'Y',TAG_YAML,ARGV_OPTARG_NONE,0,0,0, + "produce output in yaml format " + "(same as --pretty=yaml)"}, + {0,0,0,0,0,0,0,0} }; |