All arguments were passed to `arg` inside one string when building a `Command`. However, using the `arg` function, "only one argument can be passed per use." This caused all arguments accidentally to be appended to the registry URL. For example: After a successful login with a provided `--auth_type`, the success message incorrectly displayed: "Logged in as asf on https://registry.npmjs.org/%20--auth_type=Basic." The space (%20 in hex) was caused by adding a fixed space before each additional argument. This commit pushes all arguments onto a `Vec<String>`. Then, the `args` function adds the arguments separately to the command. This removes the need to prepend spaces to each argument. Alternatively, `arg` could have been used throughout to build the command argument-by-argument. However, using `args` partitions the code more neatly into two distinct sections.master
parent
0147dae9fe
commit
2343e97e1e
Loading…
Reference in new issue