* Fix fish completing for flag/option names that contain dashes.
* Fix fish completing for flag/option names that are `r`.
* Remove vestigial `present_flags_and_options` from fish completion scripts.
* Use double quotes for fish completion string test arguments.
* Simplify fish while loop.
* Make `FishCompletionsGenerator.swift` & generated fish completion scripts more concise.
* Require positional_index_comparison argument for all calls to fish shouldOfferCompletionsForPositionalFunction.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
* Complete repeatable positional instances after the first in bash.
* Complete repeatable positional instances after the first in fish.
* Only complete positionals through the first repeating positional in zsh.
* Complete repeatable flag & option instances after the first in bash.
* Complete non-repeatable flag & option instances only once in fish.
* Nonexclusive flags implemented via an array of enum cases are now separate ArgumentInfoV0 instances, instead of different names for the same ArgumentInfoV0.
* Improve ToolInfoV0 HelpCommand injection.
* Add ArgumentInfoV0.ParsingStrategyV0 enum.
* Refactor bash completions to use ToolInfoV0.
* Refactor fish completions to use ToolInfoV0.
* Refactor zsh completions to use ToolInfoV0.
* Remove vestigial shellVariableNamePrefix.
* Add .editorconfig files to prevent automatic whitespace changes to test snapshots.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
Improve zsh quoting.
Many quoting issues remain.
To fix them, there should first be enforced & documented limits on the acceptable characters in various values throughout SAP to avoid unnecessary quoting.
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
They indicate to the Swift custom completion function:
1. the word for which completions are being requested.
2. the location of the cursor within that word.
* Improve fish escaping.
* Escape backslashes for fish single-quoted strings.
If someone already escapes backslashes for such strings, this will
cause an issue, but no one should be required to go to the trouble
to manually escape backslashes in their strings, especially since
the requirement isn't documented or normal.
If someone doesn't escape backslashes, then that can break then old
version of the script.
* Output fish functions via one Swift multiline string.
* Join fish short flags/options.
* Replace fish double quotes with single quotes.
* Use option terminator in each call to string split in fish completion.
* Add default help to fish completions iff no existing help subcommand.
* Rename fish variables.
* Rename fish functions & associated Swift functions & variables.
* Inline single-use Swift variables in FishCompletionsGenerator.swift.
* Use separator in FishCompletionsGenerator.swift.
* Overhaul FishCompletionsGenerator.swift as [ParsableCommand.Type]
extension.
* Move argumentSegments(…) in FishCompletionsGenerator.swift.
* Fix fish file, directory, shell command & custom Swift call
completions.
* Properly complete fish positionals.
Fix custom completion of empty argument.
Associate a description with a fish completion iff it's a
flag/option or a subcommand.
* Improve custom completion args for fish 4+.
* Fix switch end keyword bugs in _swift_*_commands_and_positionals fish
functions.
* Lowercase fish variables that were once global but that are now local.
* Use double-quoted variable instead of `string join ''` in fish
completion scripts.
* Use option terminator in call to string split in fish completion.
* Pass each fish option spec to _swift_*_commands_and_positionals
functions as a separate argument.
* Overhaul generated fish completion scripts:
Allow positionals & subcommands on the same (sub)command.
Don't use `-r` for complete calls for positionals.
Use `-\(r)fka ''` for positionals or option values with no
completion candidates.
Allow option_specs elements to contain spaces.
Explicitly scope variables.
Rename functions.
Prevent odd characters in (sub)command names from breaking the
script in some places.
Prevent missing data from breaking if tests.
* Backwards compatibility in fish completion scripts with fish 3.3.x-
Change set -f to set -l.
Replace $(…) with (…) command substitutions.
* Change fish function prefixes from `_swift_` to `__` to align with
other shells.