@@ -337,16 +337,23 @@ impl Platform {
337
337
///
338
338
/// # Examples
339
339
///
340
- /// ```
341
- /// let (prog, args) = parse_command("code .")?;
342
- /// assert_eq!(prog, "code");
343
- /// assert_eq!(args, ".");
340
+ /// ```no_run
341
+ /// # // Since this checks if the path exists, not sure how to test this.
342
+ /// # // Don't think you can `use` a struct method.
343
+ /// # use wm::common::platform::Platform;
344
+ /// fn main() -> anyhow::Result<()> {
345
+ /// let (prog, args) = Platform::parse_command("code .")?;
346
+ /// assert_eq!(prog, "code");
347
+ /// assert_eq!(args, ".");
348
+ ///
349
+ /// let (prog, args) = Platform::parse_command(
350
+ /// r#"C:\Program Files\Git\git-bash --cd=C:\Users\larsb\.glaze-wm"#,
351
+ /// )?;
352
+ /// assert_eq!(prog, r#"C:\Program Files\Git\git-bash"#);
353
+ /// assert_eq!(args, r#"--cd=C:\Users\larsb\.glaze-wm"#);
344
354
///
345
- /// let (prog, args) = parse_command(
346
- /// r#"C:\Program Files\Git\git-bash --cd=C:\Users\larsb\.glaze-wm"#,
347
- /// )?;
348
- /// assert_eq!(prog, r#"C:\Program Files\Git\git-bash"#);
349
- /// assert_eq!(args, r#"--cd=C:\Users\larsb\.glaze-wm"#);
355
+ /// Ok(())
356
+ /// }
350
357
/// ```
351
358
pub fn parse_command ( command : & str ) -> anyhow:: Result < ( String , String ) > {
352
359
// Expand environment variables in the command string.
0 commit comments