martindevans opened issue #5404:
Feature
currently running
wasmtime settings
displays a human readable output. I propose adding a switch--machine_readable
which changes the output to something more convenient to parse (e.g. JSON).Benefit
If wasmtime is being used by other processes (e.g. our usecase has the Unity editor invoking wasmtime to precompile wasm) a machine readable output would be much more convenient to work with.
Implementation
Add this:
/// Switch output format to machine readable #[clap(long)] machine_readable: bool,
into the
SettingsCommand
struct. ModifySettingsCommand.execute
to use a different display system if true.I'm willing to open a PR for this, if it's a feature that would be accepted.
alexcrichton commented on issue #5404:
Seems reasonable to me to add! I might recommend a
--json
argument to explicitly specify the format but otherwise the idea seems fine to add through a PR.
martindevans commented on issue #5404:
Thanks. I'll try to submit a PR for a
--json
flag this weekend :+1:
martindevans commented on issue #5404:
Is
serde
available to use within this crate, or can it be added? I'm not sure what the process is for managing dependencies in wasmtime.If that's not feasible I can just emit the JSON by hand, it's not a very complicated dataset!
alexcrichton commented on issue #5404:
Yep we've got a lot of usage of serde already, so it can be added.
Last updated: Dec 23 2024 at 12:05 UTC