Skip to content

Commit

Permalink
document single quote behavior
Browse files Browse the repository at this point in the history
Closes: #4
  • Loading branch information
matklad committed Dec 23, 2024
1 parent fb141c3 commit a7753d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ const STREAM_SUFFIX_SIZE: usize = 128 * 1024; // 128KiB
/// let c = cmd!(sh, "echo {greeting}!");
/// assert_eq!(c.to_string(), r#"echo "hello world!""#);
///
/// let c = cmd!(sh, "echo 'spaces '{greeting}' around'");
/// assert_eq!(c.to_string(), r#"echo "spaces hello world around""#);
/// // Like in the shell, single quotes prevent interpolation:
/// let c = cmd!(sh, "echo 'spaces '{greeting}' around {greeting}'");
/// assert_eq!(c.to_string(), r#"echo "spaces hello world around {greeting}""#);
///
/// # Ok::<(), xshell::Error>(())
/// ```
Expand Down

0 comments on commit a7753d2

Please sign in to comment.