Skip to content

Commit

Permalink
Merge pull request #801 from kbknapp/powershell
Browse files Browse the repository at this point in the history
Powershell
  • Loading branch information
brson authored Nov 12, 2016
2 parents 4fcdfdc + dcbe02c commit 21dba64
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rustup-dist = { path = "src/rustup-dist", version = "0.6.5" }
rustup-utils = { path = "src/rustup-utils", version = "0.6.5" }
download = { path = "src/download" }
error-chain = "0.5.0"
clap = "2.16.1"
clap = "2.18.0"
regex = "0.1.41"
url = "1.1.0"
term = "0.4.4"
Expand Down
24 changes: 23 additions & 1 deletion src/rustup-cli/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,26 @@ CUSTOM LOCATIONS:
Alternatively, you could save these files to the place of your choosing,
such as a custom directory inside your $HOME. Doing so will require you
to add the proper directives, such as `source`ing inside your login
script. Consult your shells documentation for how to add such directives.";
script. Consult your shells documentation for how to add such directives.
POWERSHELL:
The powershell completion scripts require PowerShell v5.0+ (which comes
Windows 10, but can be downloaded separately for windows 7 or 8.1).
First, check if a profile has already been set
`PS C:\> Test-Path $profile`
If the above command returns `False` run the following
`PS C:\> New-Item -path $profile -type file --force`
Now open the file provided by `$profile` (if you used the `New-Item` command
it will be `%USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`
Next, we either save the completions file into our profile, or into a separate file
and source it inside our profile. To save the completions into our profile simply
use
`PS C:\> rustup completions powershell >> %USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`";
2 changes: 1 addition & 1 deletion src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub fn cli() -> App<'static, 'static> {
.after_help(COMPLETIONS_HELP)
.setting(AppSettings::ArgRequiredElseHelp)
.arg(Arg::with_name("shell")
.possible_values(&["bash", "fish", "zsh"])))
.possible_values(&Shell::variants())))
}

fn maybe_upgrade_data(cfg: &Cfg, m: &ArgMatches) -> Result<bool> {
Expand Down

0 comments on commit 21dba64

Please sign in to comment.