Skip to content

Commit a7753d2

Browse files
committed
document single quote behavior
Closes: #4
1 parent fb141c3 commit a7753d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ const STREAM_SUFFIX_SIZE: usize = 128 * 1024; // 128KiB
315315
/// let c = cmd!(sh, "echo {greeting}!");
316316
/// assert_eq!(c.to_string(), r#"echo "hello world!""#);
317317
///
318-
/// let c = cmd!(sh, "echo 'spaces '{greeting}' around'");
319-
/// assert_eq!(c.to_string(), r#"echo "spaces hello world around""#);
318+
/// // Like in the shell, single quotes prevent interpolation:
319+
/// let c = cmd!(sh, "echo 'spaces '{greeting}' around {greeting}'");
320+
/// assert_eq!(c.to_string(), r#"echo "spaces hello world around {greeting}""#);
320321
///
321322
/// # Ok::<(), xshell::Error>(())
322323
/// ```

0 commit comments

Comments
 (0)