Update examples

pull/2569/head
Tony 4 months ago
parent 80422ea760
commit 3bf58eedb9
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

@ -57,11 +57,9 @@ First you need to register the core plugin with Tauri:
`src-tauri/src/lib.rs`
```rust
use tauri_plugin_autostart::MacosLauncher;
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */))
.plugin(tauri_plugin_autostart::Builder::new().args((["--flag1", "--flag2"])).build()))
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

@ -119,8 +119,7 @@ impl Builder {
/// Builder::new()
/// .arg("--from-autostart")
/// .arg("--hey")
/// .build()
/// .unwrap();
/// .build();
/// ```
pub fn arg<S: Into<String>>(mut self, arg: S) -> Self {
self.args.push(arg.into());
@ -134,8 +133,7 @@ impl Builder {
/// ```no_run
/// Builder::new()
/// .args(["--from-autostart", "--hey"])
/// .build()
/// .unwrap();
/// .build();
/// ```
pub fn args<I, S>(mut self, args: I) -> Self
where

Loading…
Cancel
Save