Skip to content

Commit

Permalink
middleground
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Jul 1, 2023
1 parent 89f97cd commit 67c3ce1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion crates/tests/riddle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn run_riddle(name: &str) -> Vec<windows_metadata::File> {
let mut command = Command::new("cargo");
command.args([
"run", "-p", "riddle", "--", "--in", &idl, "--out", &rs, "--filter", "Test",
]); // TODO: -config FLATTEN doesn't work for namespaces
]); // TODO: --config FLATTEN doesn't work for namespaces
assert!(command.status().unwrap().success());

// Return winmd file for validation
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/standalone/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ fn riddle(output: &str, filter: &[&str], config: &[&str]) {
]);

command.args(filter);
command.arg("-config");
command.arg("--config");
command.args(config);

if !command.status().unwrap().success() {
Expand Down
4 changes: 2 additions & 2 deletions crates/tools/core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
"-p",
"riddle",
"--",
"-@",
"--etc",
"crates/tools/core/bindings.txt",
]);

Expand All @@ -19,7 +19,7 @@ fn main() {
"-p",
"riddle",
"--",
"-@",
"--etc",
"crates/tools/core/com_bindings.txt",
]);

Expand Down
2 changes: 1 addition & 1 deletion crates/tools/metadata/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
"-p",
"riddle",
"--",
"-@",
"--etc",
"crates/tools/metadata/bindings.txt",
]);

Expand Down
2 changes: 1 addition & 1 deletion crates/tools/riddle/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn from_iter<T: Iterator<Item = String>>(result: &mut Vec<String>, args: T) -> R
for args in crate::read_file_lines(&arg)? {
from_string(result, &args)?;
}
} else if arg == "-@" {
} else if arg == "--etc" {
expand = true;
} else {
result.push(arg);
Expand Down
15 changes: 6 additions & 9 deletions crates/tools/riddle/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ fn run() -> Result<()> {
r#"Usage: riddle.exe [options...]
Options:
-i,--in <path> Path to files and directories containing .winmd and .idl files
-o,--out <path> Path to .winmd, .idl, or .rs file to generate
-f,--filter <namespace> Namespaces to include or !exclude in output
-c,--config <key=value> Override a configuration value
--format Format .idl files only
-@ <path> File containing command line options
--in <path> Path to files and directories containing .winmd and .idl files
--out <path> Path to .winmd, .idl, or .rs file to generate
--filter <namespace> Namespaces to include or !exclude in output
--config <key=value> Override a configuration value
--format Format .idl files only
--etc <path> File containing command line options
"#
);
return Ok(());
Expand All @@ -60,11 +60,8 @@ Options:
match kind {
ArgKind::None => match arg.as_str() {
"--in" => kind = ArgKind::Input,
"-i" => kind = ArgKind::Input,
"--out" => kind = ArgKind::Output,
"-o" => kind = ArgKind::Output,
"--filter" => kind = ArgKind::Filter,
"-c" => kind = ArgKind::Config,
"--config" => kind = ArgKind::Config,
"--format" => format = true,
_ => return Err(Error::new(&format!("invalid option `{arg}`"))),
Expand Down
2 changes: 1 addition & 1 deletion crates/tools/sys/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
"-p",
"riddle",
"--",
"-@",
"--etc",
"crates/tools/sys/bindings.txt",
]);

Expand Down
2 changes: 1 addition & 1 deletion crates/tools/windows/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
"-p",
"riddle",
"--",
"-@",
"--etc",
"crates/tools/windows/bindings.txt",
]);

Expand Down

0 comments on commit 67c3ce1

Please sign in to comment.