Skip to content

Commit 705db7b

Browse files
committed
More Windows argument handling experiments
1 parent d114bf0 commit 705db7b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ fn parse_args() -> Args {
118118
.index(1)
119119
.about("Script file or expression to execute.")
120120
.required_unless_present_any(if cfg!(windows) {
121-
vec!["clear-cache", "list-templates", "file-association"]
121+
vec!["clear-cache", "list-templates", "install-file-association", "uninstall-file-association"]
122122
} else {
123123
vec!["clear-cache", "list-templates"]
124124
})
125125
.number_of_values(1)
126126
.conflicts_with_all(if cfg!(windows) {
127-
&["list-templates", "file-association"]
127+
&["list-templates", "install-file-association", "uninstall-file-association"]
128128
} else {
129129
&["list-templates"]
130130
})
@@ -151,7 +151,6 @@ fn parse_args() -> Args {
151151
)
152152
.group(ArgGroup::new("expr_or_loop")
153153
.args(&["expr", "loop"])
154-
.conflicts_with_all(&["list-templates", "file-association"])
155154
)
156155
/*
157156
Options that impact the script being executed.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
use std::env;
22

3+
mod script_module {
4+
include!(concat!(env!("RUST_SCRIPT_BASE_PATH"), "/script-module.rs"));
5+
}
6+
37
fn main() {
48
println!("--output--");
59
let s = include_str!(concat!(env!("RUST_SCRIPT_BASE_PATH"), "/file-to-be-included.txt"));
10+
assert_eq!(script_module::A_VALUE, 1);
611
println!("{}", s);
712
}

tests/data/script-module.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub const A_VALUE: i32 = 1;

0 commit comments

Comments
 (0)