[sledge] Explicate output flag of disassemble command

Summary: This one was overlooked before

Reviewed By: kren1

Differential Revision: D16269729

fbshipit-source-id: 0aa86ca9a
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent 9865bc0f74
commit 0126b64d16

@ -186,8 +186,8 @@ The <input> file must be LLAIR code, as produced by `sledge llvm translate`.
=== flags === === flags ===
[-colors] enable printing in colors [-colors] enable printing in colors
[-llair <file>] write generated textual LLAIR to <file>, or to standard [-llair-txt-output <file>] write generated textual LLAIR to <file>, or to
output if omitted standard output if omitted
[-margin <cols>] wrap debug tracing at <cols> columns [-margin <cols>] wrap debug tracing at <cols> columns
[-trace <spec>] enable debug tracing [-trace <spec>] enable debug tracing
[-help] print this help text and exit [-help] print this help text and exit

@ -153,15 +153,15 @@ let disassemble_cmd =
in in
let param = let param =
let%map_open input = anon ("<input>" %: string) let%map_open input = anon ("<input>" %: string)
and llair = and llair_txt_output =
flag "llair" (optional string) flag "llair-txt-output" (optional string)
~doc: ~doc:
"<file> write generated textual LLAIR to <file>, or to standard \ "<file> write generated textual LLAIR to <file>, or to standard \
output if omitted" output if omitted"
in in
fun () -> fun () ->
let program = unmarshal input () in let program = unmarshal input () in
match llair with match llair_txt_output with
| None -> Format.printf "%a@." Llair.pp program | None -> Format.printf "%a@." Llair.pp program
| Some file -> | Some file ->
Out_channel.with_file file ~f:(fun oc -> Out_channel.with_file file ~f:(fun oc ->

Loading…
Cancel
Save