-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,092 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
description: Command line reference for the 'dsc completer' command | ||
ms.date: 10/05/2023 | ||
ms.topic: reference | ||
title: dsc schema | ||
--- | ||
|
||
# dsc schema | ||
|
||
## Synopsis | ||
|
||
Generates a shell completion script. | ||
|
||
## Syntax | ||
|
||
```sh | ||
dsc completer [Options] <SHELL> | ||
``` | ||
|
||
## Description | ||
|
||
The `completer` command returns a shell script that, when executed, registers completions for the | ||
given shell. DSC can generate completion scripts for the following shells: | ||
|
||
- [Bourne Again SHell (BASH)][01] | ||
- [Elvish][02] | ||
- [Friendly Interactive SHell (fish)][03] | ||
- [PowerShell][04] | ||
- [Z SHell (ZSH)][05] | ||
|
||
The output for this command is the script itself. To register completions for DSC, execute the | ||
script. | ||
|
||
> [!WARNING] | ||
> Always review scripts before executing them, especially in an elevated execution context. | ||
## Examples | ||
|
||
### Example 1 - Register completions for Bash | ||
|
||
```sh | ||
completer=~/dsc_completion.bash | ||
# Export the completion script | ||
dsc completer bash > $completer | ||
# Review the completion script | ||
cat $completer | ||
# Add the completion script to your profile | ||
echo "source $completer" >> ~/.bashrc | ||
# Execute the completion script to register completions for this session | ||
source $completer | ||
``` | ||
|
||
### Example 2 - Register completions for PowerShell | ||
|
||
```powershell | ||
$Completer = '~/dsc_completion.ps1' | ||
# Export the completion script | ||
dsc completer powershell | Out-File $Completer | ||
# Review the completion script | ||
Get-Content $completer | ||
# Add the completion script to your profile | ||
Add-Content -Path $PROFILE ". $Completer" | ||
# Execute the completion script to register completions for this session | ||
. $Completer | ||
``` | ||
|
||
## Arguments | ||
|
||
### SHELL | ||
|
||
This argument is mandatory for the `completer` command. The value for this option determines which | ||
shell the application returns a completion script for: | ||
|
||
- `bash` - [Bourne Again SHell (BASH)][01] | ||
- `elvish` - [Elvish][02] | ||
- `fish` - [Friendly Interactive SHell (fish)][03] | ||
- `powershell` - [PowerShell][04] | ||
- `zsh` - [Z SHell (ZSH)][05] | ||
|
||
```yaml | ||
Type: String | ||
Mandatory: true | ||
ValidValues: [ | ||
bash, | ||
elvish, | ||
fish, | ||
powershell, | ||
zsh, | ||
] | ||
``` | ||
## Options | ||
### -h, --help | ||
Displays the help for the current command or subcommand. When you specify this option, the | ||
application ignores all options and arguments after this one. | ||
```yaml | ||
Type: Boolean | ||
Mandatory: false | ||
``` | ||
[01]: https://www.gnu.org/software/bash/ | ||
[02]: https://elv.sh/ | ||
[03]: https://fishshell.com/ | ||
[04]: https://learn.microsoft.com/powershell/scripting/overview | ||
[05]: https://zsh.sourceforge.io/ |
Oops, something went wrong.