PSCompletions and argc-completions
TIP
- argc-completions is a command-completion repository for 1000+ commands.
- PSCompletions can work with argc-completions by following these steps
Use Scoop
Add the abyss bucket via Github or Gitee.
shscoop bucket add abyss https://github.com/abgox/abyss
shscoop bucket add abyss https://gitee.com/abgox/abyss
Install Argc-completions.
shellscoop install abyss/sigoden.Argc-completions
Add the following code into
$Profile
.powershell# argc-completions # To add completions for only the specified command, modify next line e.g. $argc_scripts = @("cargo", "git") $argc_scripts = $env:ARGC_COMPLETIONS_PATH -split [System.IO.Path]::PathSeparator | Get-ChildItem -File | ForEach-Object { $_.BaseName } argc --argc-completions powershell $argc_scripts | Out-String | Invoke-Expression $PSCompletions.argc_completions($argc_scripts)
Don't use Scoop
- You need a quick start to argc-completions.
Please refer to the latest argc-completions repo.
bash
git clone https://github.com/sigoden/argc-completions.git
cd argc-completions
./scripts/download-tools.sh
./scripts/setup-shell.sh powershell
- At last, argc-completions requires you to add the following code into
$Profile
.
You need to replace the last line as in the following example code.
powershell
# argc-completions
$env:ARGC_COMPLETIONS_ROOT = 'D:\argc-completions'
$env:ARGC_COMPLETIONS_PATH = ($env:ARGC_COMPLETIONS_ROOT + '\completions\windows;' + $env:ARGC_COMPLETIONS_ROOT + '\completions')
$env:PATH = $env:ARGC_COMPLETIONS_ROOT + '\bin' + [IO.Path]::PathSeparator + $env:PATH
# To add completions for only the specified command, modify next line e.g. $argc_scripts = @("cargo", "git")
$argc_scripts = $env:ARGC_COMPLETIONS_PATH -split [System.IO.Path]::PathSeparator | Get-ChildItem -File | ForEach-Object { $_.BaseName }
argc --argc-completions powershell $argc_scripts | Out-String | Invoke-Expression
$PSCompletions.argc_completions($argc_scripts)