summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/r2md-append.rs19
-rw-r--r--src/bin/r2md-prepend.rs19
2 files changed, 38 insertions, 0 deletions
diff --git a/src/bin/r2md-append.rs b/src/bin/r2md-append.rs
index 4cd2ae9..4dd0698 100644
--- a/src/bin/r2md-append.rs
+++ b/src/bin/r2md-append.rs
@@ -47,4 +47,23 @@ mod tests {
vec![OsString::from("README.md"), OsString::from("src/main.rs")]
);
}
+
+ #[test]
+ fn treats_arguments_after_double_dash_as_paths() {
+ let cli = Cli::try_parse_from([
+ "r2md-append",
+ "--",
+ "--filename-that-looks-like-an-option",
+ "main.rs",
+ ])
+ .unwrap();
+
+ assert_eq!(
+ cli.paths,
+ vec![
+ OsString::from("--filename-that-looks-like-an-option"),
+ OsString::from("main.rs")
+ ]
+ );
+ }
}
diff --git a/src/bin/r2md-prepend.rs b/src/bin/r2md-prepend.rs
index 2649587..7297fb6 100644
--- a/src/bin/r2md-prepend.rs
+++ b/src/bin/r2md-prepend.rs
@@ -47,4 +47,23 @@ mod tests {
vec![OsString::from("README.md"), OsString::from("src/main.rs")]
);
}
+
+ #[test]
+ fn treats_arguments_after_double_dash_as_paths() {
+ let cli = Cli::try_parse_from([
+ "r2md-prepend",
+ "--",
+ "--filename-that-looks-like-an-option",
+ "main.rs",
+ ])
+ .unwrap();
+
+ assert_eq!(
+ cli.paths,
+ vec![
+ OsString::from("--filename-that-looks-like-an-option"),
+ OsString::from("main.rs")
+ ]
+ );
+ }
}