wasmer_cli/
common.rs

1//! Common module with common used structures across different
2//! commands.
3
4use clap::Parser;
5
6#[derive(Debug, Parser, Clone, Default)]
7/// The WebAssembly features that can be passed through the
8/// Command Line args.
9pub struct WasmFeatures {
10    /// Enable support for the SIMD proposal.
11    #[clap(long = "enable-simd")]
12    pub simd: bool,
13
14    /// Disable support for the threads proposal.
15    #[clap(long = "disable-threads")]
16    pub disable_threads: bool,
17
18    /// Deprecated, threads are enabled by default.
19    #[clap(long = "enable-threads")]
20    pub _threads: bool,
21
22    /// Enable support for the reference types proposal.
23    #[clap(long = "enable-reference-types")]
24    pub reference_types: bool,
25
26    /// Enable support for the multi value proposal.
27    #[clap(long = "enable-multi-value")]
28    pub multi_value: bool,
29
30    /// Enable support for the bulk memory proposal.
31    #[clap(long = "enable-bulk-memory")]
32    pub bulk_memory: bool,
33
34    /// Enable support for all pre-standard proposals.
35    #[clap(long = "enable-all")]
36    pub all: bool,
37}
38
39pub(crate) fn normalize_path(s: &str) -> String {
40    s.strip_prefix(r"\\?\").unwrap_or(s).to_string()
41}