electron_sys/class/
command_line.rs

1use js_sys::{JsString, Object};
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen(module = "electron")]
5extern {
6    #[wasm_bindgen(extends = Object)]
7    #[derive(Clone, Debug, Eq, PartialEq)]
8    /// Docs: http://electronjs.org/docs/api/command-line
9    pub type CommandLine;
10
11    //******************//
12    // Instance Methods //
13    //******************//
14
15    #[wasm_bindgen(method, js_name = "appendArgument")]
16    pub fn append_argument(this: &CommandLine, value: &str);
17
18    #[wasm_bindgen(method, js_name = "appendSwitch")]
19    pub fn append_switch(this: &CommandLine, switch: &str, value: Option<&str>);
20
21    // FIXME: null is empty string from electron; we could return Option though
22    #[wasm_bindgen(method, js_name = "getSwitchValue")]
23    pub fn get_switch_value(this: &CommandLine, switch: &str) -> JsString;
24
25    #[wasm_bindgen(method, js_name = "hasSwitch")]
26    pub fn has_switch(this: &CommandLine, switch: &str) -> bool;
27}