-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
complete, compgen, compopt: refresh pages #17638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+40
−14
Merged
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
778ba39
Update complete.md
Managor ab0083a
Update complete.md
Managor 9712bb5
Update compgen.md
Managor d29f892
Update compgen.md
Managor 92dfbb4
Update complete.md
Managor 154886e
Update compgen.md
Managor a2facea
Update compopt.md
Managor 97394db
Update compopt.md
Managor 1c5535e
Update compgen.md
Managor b435054
Update compgen.md
Managor 9bb28bb
Update complete.md
Managor 6e6ae54
Update complete.md
Managor c929c74
Update complete.md
Managor 6616caa
Update compopt.md
Managor 3f42633
Update compopt.md
Managor 2184ad8
Update compgen.md
Managor d5b355d
Update compgen.md
Managor b06a1d4
Update compgen.md
Managor d8e1ead
Update complete.md
Managor 296f356
Update compopt.md
Managor 767570f
Update compopt.md
Managor f2d2d06
Update complete.md
Managor 24b74a4
Update pages/common/compopt.md
Managor 7427a9f
Merge branch 'main' into complete
Managor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,16 +1,30 @@ | ||
# complete | ||
|
||
> Get argument autocompletion to shell commands. | ||
> Get and set argument autocompletion rules of shell commands in Bash. | ||
> The specified completions will be invoked when `<Tab>` is pressed in Bash. | ||
> See also: `compgen`, `compopt`. | ||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#index-complete>. | ||
|
||
- Apply a function that performs autocompletion to a command: | ||
- Set arguments of a command to autocomplete through a function (completion response is sent in `COMPREPLY` variable): | ||
|
||
`complete -F {{function}} {{command}}` | ||
|
||
- Apply a command that performs autocompletion to another command: | ||
- Set arguments of a command to autocomplete through another command (`$1` is the command, `$2` is the argument the cursor is on, and `$3` is the argument preceding the cursor): | ||
|
||
`complete -C {{autocomplete_command}} {{command}}` | ||
|
||
- Set arguments of a command to autocomplete to shell builtins: | ||
|
||
`complete -A builtin {{command}}` | ||
|
||
- Apply autocompletion without appending a space to the completed word: | ||
|
||
`complete -o nospace -F {{function}} {{command}}` | ||
|
||
- List all loaded complete specifications: | ||
|
||
`complete -p` | ||
|
||
- List loaded complete specifications for a command: | ||
|
||
`complete -p {{command}}` |
This file contains hidden or 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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
# compopt | ||
|
||
> Print or change the completion options for a command. | ||
> More information: <https://manned.org/compopt>. | ||
> `-o` means enabled and `+o` means disabled. | ||
> See also: `compgen`, `complete`. | ||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-compopt>. | ||
|
||
- Print the completion options for given command: | ||
|
||
`compopt {{command}}` | ||
|
||
- Enable or disable a completion option of a command: | ||
|
||
`compopt {{-o|+o}} {{option1}} {{-o|+o}} {{option2}} {{command}}` | ||
|
||
- Print the options for the currently executing completion: | ||
|
||
`compopt` | ||
|
||
- Print the completion options for given command: | ||
- Enable or disable a completion option of a command: | ||
|
||
`compopt {{command}}` | ||
`compopt {{-o|+o}} {{option1}} {{-o|+o}} {{option2}}` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.