summaryrefslogtreecommitdiffhomepage
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-11-28 07:14:21 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:28 -0500
commit0d3dde49e65c9de9dff41933ceb64fa28635499d (patch)
tree036af41884253f469dc6cc26009f56630befce19 /src/driver
parentdd97ea947fa5a9796507a092b3d9e7984712e80b (diff)
downloadperk-0d3dde49e65c9de9dff41933ceb64fa28635499d.tar.bz2
perk-0d3dde49e65c9de9dff41933ceb64fa28635499d.tar.xz
pretty printer: yaml support: initial implementation.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/pe_driver_ctx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 97ff3fa..32e0819 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -8,6 +8,7 @@ enum app_tags {
TAG_HELP,
TAG_VERSION,
TAG_OUTPUT,
+ TAG_PRETTY,
TAG_EXPSYMS,
TAG_IMPLIBS,
TAG_IMPSYMS,
@@ -24,6 +25,9 @@ static const struct argv_option options[] = {
{"output", 'o',TAG_OUTPUT, ARGV_OPTARG_REQUIRED, 0,"<file>",
"write output to %s"},
+ {"pretty", 'p',TAG_PRETTY, ARGV_OPTARG_REQUIRED, "yaml",0,
+ "format output for parsing by %s"},
+
{"expsyms", 'e',TAG_EXPSYMS,ARGV_OPTARG_NONE, 0,0,
"print exported symbols" },
@@ -127,6 +131,7 @@ int pe_get_driver_ctx(
uint64_t fflags;
const char * program;
const char * output;
+ const char * pretty;
int fdout;
if (!(meta = argv_get(argv,options,pe_argv_flags(flags))))
@@ -135,6 +140,7 @@ int pe_get_driver_ctx(
dflags = 0;
fflags = 0;
output = 0;
+ pretty = 0;
nunits = 0;
program = argv_program_name(argv[0]);
@@ -157,6 +163,10 @@ int pe_get_driver_ctx(
output = entry->arg;
break;
+ case TAG_PRETTY:
+ pretty = entry->arg;
+ break;
+
case TAG_EXPSYMS:
fflags |= PERK_OUTPUT_EXPORT_SYMS;
break;
@@ -184,6 +194,9 @@ int pe_get_driver_ctx(
if (!ctx)
return pe_get_driver_ctx_fail(meta);
+ if (pretty && !strcmp(pretty,"yaml"))
+ fflags |= PERK_PRETTY_YAML;
+
ctx->program = program;
ctx->cctx.drvflags = dflags;
ctx->cctx.fmtflags = fflags;