wasmx / wasm-chisel

Some useful utilities to transform WebAssembly binaries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI

axic opened this issue · comments

The original proposal for CLI was only have a configuration format.

This briefly described in the README: https://github.com/wasmx/wasm-chisel#configuration-file-wip

@jakelang has raised that it would make sense to have a stand alone tool too.

I think we could do something like this, in line with other tools:

  • chisel carve (with chisel run for the old-school folks) which looks for a configuration file and executes it
  • chisel carve <module> {params} <filename>

Suggestion by @jakelang

  • Maybe chisel validate?
  • Or just drop subcommands completely and do chisel -m , e.g chisel translate for translation etc

I think it makes sense following the internal abstraction and have create / validate / translate:

  • chisel create <module> {options}
  • chisel validate <module> {options}
  • chisel translate <module> {options}

Common options:

  • --output: output filename. Required for create and translate.
  • --inplace: valid for translate, in that case output is optional and it changes the source file.

Alternatively: chisel with no subcommand will search for a chisel.yaml, in the current dir, $HOME, and $PATH in that order.

chisel with a subcommand validate | create | translate and a module list will run specific modules of the kind on the provided binary.

The agreement is:

  • chisel run searches for chisel.yml / chisel.toml (need to decide)
  • chisel create/etc. as in
    #26 (comment)

@axic voting for YAML.

I prefer yaml, but if toml is easier in Rust it is fine with me.