Skip to content

Commit

Permalink
docs: fix comment typos and adjust style
Browse files Browse the repository at this point in the history
Addresses PR #556 comments by @SteveLauC
  • Loading branch information
ssmendon authored Sep 26, 2023
1 parent 13226c2 commit d0d2ac9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/steps/os/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,22 @@ fn upgrade_wsl_distribution(wsl: &Path, dist: &str, ctx: &ExecutionContext) -> R
//
// ```rust
// command
// .args(["bash", "-c"])
// .arg(format!("exec {topgrade}"));
// .args(["-d", dist, "bash", "-c"])
// .arg(format!("TOPGRADE_PREFIX={dist} exec {topgrade}"));
// ```
//
// creates a command string like:
// `bash -c 'exec /bin/topgrade'`
// and using `command.args(...).arg("topgrade").arg("-v")`
// on that again creates
// `bash -c 'exec /bin/topgrade' -v`
// which means `-v` isn't passed to `topgrade`.
// > `C:\WINDOWS\system32\wsl.EXE -d Ubuntu bash -c 'TOPGRADE_PREFIX=Ubuntu exec /bin/topgrade'`
//
// Adding the following:
//
// ```rust
// command.arg("-v");
// ```
//
// appends the next argument like so:
// > `C:\WINDOWS\system32\wsl.EXE -d Ubuntu bash -c 'TOPGRADE_PREFIX=Ubuntu exec /bin/topgrade' -v`
// which means `-v` isn't passed to `topgrade`.
let mut args = String::new();
if ctx.config().verbose() {
args.push_str("-v");
Expand Down

0 comments on commit d0d2ac9

Please sign in to comment.