From 95f680324169948aa86c67a89faf2e194e700a20 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 14 Feb 2024 21:53:50 +0100 Subject: [PATCH] docs/completions: Remove duplicated content Fixes #fish-site/121 --- doc_src/completions.rst | 42 ----------------------------------------- 1 file changed, 42 deletions(-) diff --git a/doc_src/completions.rst b/doc_src/completions.rst index 3a9ddb36f..0017a4cb3 100644 --- a/doc_src/completions.rst +++ b/doc_src/completions.rst @@ -11,48 +11,6 @@ To provide a list of possible completions for myprog, use the ``-a`` switch. If complete -c myprog -s o -l output -a "yes no" - -In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for:: - - > myprog -o - > myprog --output= - -By default, option arguments are *optional*, so the candidates are only offered directly attached like that, so they aren't given in this case:: - - > myprog -o - -Usually options *require* a parameter, so you would give ``--require-parameter`` / ``-r``:: - - complete -c myprog -s o -l output -ra "yes no" - -which offers yes/no in these cases:: - - > myprog -o - > myprog --output= - > myprog -o - > myprog --output - -In the latter two cases, files will also be offered because file completion is enabled by default. - -You would either inhibit file completion for a single option:: - - complete -c myprog -s o -l output --no-files -ra "yes no" - -or with a specific condition:: - - complete -c myprog -f --condition '__fish_seen_subcommand_from somesubcommand' - -or you can disable file completions globally for the command:: - - complete -c myprog -f - -If you have disabled them globally, you can enable them just for a specific condition or option with the ``--force-files`` / ``-F`` option:: - - # Disable files by default - complete -c myprog -f - # but reenable them for --config-file - complete -c myprog -l config-file --force-files -r - In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for:: > myprog -o