Skip to main content

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. Singlepass support for multi-value is
27    /// experimental and does not include integration with host functions returning multiple values.
28    #[clap(long = "enable-multi-value")]
29    pub multi_value: bool,
30
31    /// Enable support for the bulk memory proposal.
32    #[clap(long = "enable-bulk-memory")]
33    pub bulk_memory: bool,
34
35    /// Enable support for all pre-standard proposals.
36    #[clap(long = "enable-all")]
37    pub all: bool,
38}
39
40pub(crate) fn normalize_path(s: &str) -> String {
41    s.strip_prefix(r"\\?\").unwrap_or(s).to_string()
42}