Commit Graph

21 Commits

Author SHA1 Message Date
matsuji 99e2e97fd9 Improve fish completion (#376, #534) (#535)
A generated fish script didn't complete an option after an argument.

The cause is the generated fish script doesn't accept an input text which already has arguments.
For example, when the input is `repeat -`, the script can complete `--count`, but when the text is `repeat foo -`, the script cannot complete `repeat foo --count`, because the input text already has the argument "foo".

To fix the issue, `FishCompletionsGenerator` got a capability that can accept a text which has arguments.
2023-01-09 10:55:41 -06:00
Aaron Gyes 7e04f56c1d Rename ...using_command fish function, set $cmd in local scope (#377)
__fish_* should not be used by external projects.
set -l cmd in case user has a global or universal `cmd` defined.
2021-12-10 13:31:20 -06:00
Jake Petroules b2e411887e Fix compile failure on iOS for Mac Catalyst support (#372) 2021-11-08 19:50:43 -06:00
Nate Cook 685341f629 Use standard path for --dump-help help/completions, remove completions (#339) 2021-07-20 12:59:36 -05:00
Kotaro Suto cfcb9cb0cd Add new built-in flag --dump-help (#310)
This commit will add a new builtin option named `--dump-help-info` which
outputs help information in JSON.
2021-07-07 13:09:21 -05:00
François Lamboley 37610bc875 Fix executable path when calling custom completion in bash (#323) 2021-06-10 11:07:02 -05:00
François Lamboley e566395765 Fix custom completion args for bash (#320) 2021-06-04 09:53:48 -05:00
Nate Cook 167704f261 Ignore extra help flags when given with the 'help' subcommand (#309) 2021-05-14 17:28:32 -05:00
Nate Cook 267f707294 Use custom help flags in completion scripts (#308)
* Standardize the help and version flag generation
* Simplify some help generation code
* Support custom help flags in completion scripts
2021-05-14 10:27:05 -05:00
Alfredo Delli Bovi 4793b0f4b9 Include help text in error message when validation fails (#283) 2021-03-06 13:11:58 -06:00
Nate Cook 605a2330c5 Suppress hidden arguments from completion scripts (#271) 2021-02-11 10:41:46 -06:00
Daniel Duan 2104b1a314 Add Fish completion generator (#226) 2020-08-13 12:11:08 -05:00
Nate Cook b905f5c777 Improve the completion tests a bit (#228) 2020-08-12 14:17:58 -05:00
Brandon Evans 115cacd4a1 Improve support for multi-word completion strings in ZSH (#216)
* Improve support for multi-word completions in Z shell

I will not pretend to fully understand why this new "expand string into array" expression works when the other didn't, but it does. The new expression is based on this SO answer: https://unix.stackexchange.com/a/29748.

The motivation for this change was for the install command of xcodes (https://github.com/RobotsAndPencils/xcodes) to support Xcode version completion strings with multiple words, like "11.6 Beta". The previous version of this expression would split this string into two, so that "11.6" and "Beta" were independent options in the ZSH completion UI, which didn't make sense for this use case.
2020-08-05 11:49:05 -05:00
Stuart Carnie 163211e2e4 fix: Improve zsh completion script generator (#219)
* `shellCommand` stores output in a local array that is passed
  to `_describe` to handle spaces and other punctuation in
  the shell command output

* elide the help abstract if it is empty, as it confuses
  the zsh completion system

* set the `_<commandName>_commandname` to `$words[1]`, which
  is the full name of the command used to invoke the completion.
  This ensures invocations like `./build/debug/math` ...
  as passed on to the `_custom_completion` command.
2020-08-03 14:26:25 -05:00
Nate Cook 280700d361 Add completion script generation (#123)
Support for generating shell completion scripts for `ParsableCommand`
types, with customization points for `ExpressibleByArgument` types and
individual arguments and options. Zsh and Bash are supported in this
initial release.
2020-07-29 17:58:44 -05:00
Artem Novichkov 02a95bdaea Help message for default subcommands (#183)
* Update label for default subcommand

* Add test for default subcommand

* Fix test fixtures with default subcommand help message
2020-06-11 11:09:26 -05:00
Nate Cook 85196ee1d8 Additional help messages (#165)
* Add 'see help' messages to usage messages and the help screen

* Update tests for new help messages.

* Update guide examples with additional help messages
2020-05-22 17:04:14 -05:00
Nate Cook 31799bc1b4 Add built-in support for --version flag (#102)
* Add built-in support for --version flag

* Test that command-defined --version overrides the built-in.

* Document the `version:` parameter in CommandConfiguration

* Include --version in the generated help.
2020-03-30 12:36:21 -05:00
Nate Cook ddc828f8cb Add an API for converting an error to an exit code (#79)
* Add an API for converting an error to an exit code

* Make ExitCode more useful as a value type

* Update tests to use ExitCode values

* Typo fix

* Add a test for ExitCode.isSuccess

* Switch to just using ExitCode for tests
2020-03-21 12:44:32 -05:00
Elliott Williams 34300696f5 Prefix test target names with "ArgumentParser" (#74)
* Prefix testing and test helper targets with ArgumentParser

* Replace SAP with ArgumentParser in imports and CMakeLists
2020-03-10 12:44:07 -05:00