Skip to content

Commit

Permalink
[wasm-tools] support config --indent-text for print command
Browse files Browse the repository at this point in the history
  • Loading branch information
oovm committed Dec 23, 2024
1 parent 684fc09 commit b9de9be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bin/wasm-tools/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub struct Opts {
/// Print instructions in the folded format.
#[clap(short, long)]
fold_instructions: bool,
/// The string to use when indenting.
#[clap(long)]
indent_text: Option<String>,
}

impl Opts {
Expand All @@ -45,6 +48,9 @@ impl Opts {
config.print_skeleton(self.skeleton);
config.name_unnamed(self.name_unnamed);
config.fold_instructions(self.fold_instructions);
if let Some(s) = self.indent_text.as_ref() {
config.indent_text(s);
}
self.io.output(wasm_tools::Output::Wat {
wasm: &wasm,
config,
Expand Down

0 comments on commit b9de9be

Please sign in to comment.