mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-11 02:51:15 -03:00
Compare commits
77 Commits
Integratio
...
Integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a982fe71f | ||
|
|
88d3803503 | ||
|
|
ef5b29652f | ||
|
|
b4ee54dc68 | ||
|
|
9043008933 | ||
|
|
01d681067c | ||
|
|
52d2087dd3 | ||
|
|
9b4c4ee7b6 | ||
|
|
031a6a09a4 | ||
|
|
9ee82b143a | ||
|
|
f9f29f0737 | ||
|
|
cd17c1281d | ||
|
|
1564c3e181 | ||
|
|
093c580b5c | ||
|
|
fd8291a96f | ||
|
|
48db9e6a3f | ||
|
|
83d95cea35 | ||
|
|
772a367365 | ||
|
|
69b28fc490 | ||
|
|
d952ca1d1e | ||
|
|
dda0c8178d | ||
|
|
e84f588d11 | ||
|
|
00d7b817aa | ||
|
|
72a7111260 | ||
|
|
21026421a0 | ||
|
|
bb6160bae4 | ||
|
|
97bef63af6 | ||
|
|
78cc872904 | ||
|
|
dc51a12b4f | ||
|
|
6df09b3753 | ||
|
|
256713b670 | ||
|
|
077118d983 | ||
|
|
f6f10353be | ||
|
|
da0c640750 | ||
|
|
5c56fa0e6f | ||
|
|
7fa13e4451 | ||
|
|
8203fdf631 | ||
|
|
a322e3f180 | ||
|
|
b9adb8466f | ||
|
|
9ef7fe1a15 | ||
|
|
dad8c527e0 | ||
|
|
1b1cf73b60 | ||
|
|
572a568268 | ||
|
|
27952db9f7 | ||
|
|
4ceb497bfb | ||
|
|
1d29ae7847 | ||
|
|
905f788b3e | ||
|
|
1d455be9fa | ||
|
|
96c9cb369b | ||
|
|
5792e4a12b | ||
|
|
51bce422fd | ||
|
|
2da1a4ae77 | ||
|
|
f7f052ad40 | ||
|
|
16369a3abb | ||
|
|
abbb75ea66 | ||
|
|
126647380a | ||
|
|
f1a150ed43 | ||
|
|
ead0b03108 | ||
|
|
afd242b14d | ||
|
|
9e1c8a70bf | ||
|
|
15939be56c | ||
|
|
31093ed9ce | ||
|
|
9e81d7e166 | ||
|
|
d2f5daf8e8 | ||
|
|
5e0f9521a5 | ||
|
|
92b1394178 | ||
|
|
eb4dc101df | ||
|
|
08728be319 | ||
|
|
2357c9f577 | ||
|
|
550857ef65 | ||
|
|
a0840637fa | ||
|
|
a40b019752 | ||
|
|
6ce0b93851 | ||
|
|
fc7989cecd | ||
|
|
30c708e8a5 | ||
|
|
5c216e3d8c | ||
|
|
7ff0e7d0f7 |
@@ -1,3 +1,60 @@
|
||||
fish 3.6.1 (released ???)
|
||||
===================================
|
||||
|
||||
.. ignore: 9439 9440 9442 9452 9469 9480 9482
|
||||
|
||||
Notable improvements and fixes
|
||||
------------------------------
|
||||
- ``abbr --erase`` now also erases the universal variables used by the old abbr function. That means::
|
||||
abbr --erase (abbr --list)
|
||||
|
||||
can now be used to clean out all old abbreviations (:issue:`9468`).
|
||||
- ``abbr --add --universal`` now warns about --universal being non-functional, to make it easier to detect old-style ``abbr`` calls (:issue:`9475`).
|
||||
|
||||
Deprecations and removed features
|
||||
---------------------------------
|
||||
|
||||
Scripting improvements
|
||||
----------------------
|
||||
- ``abbr --list`` no longer escapes the abbr name, which is necessary to be able to pass it to ``abbr --erase`` (:issue:`9470`).
|
||||
- ``read`` will now print an error if told to set a read-only variable instead of silently doing nothing (:issue:`9346`).
|
||||
|
||||
Interactive improvements
|
||||
------------------------
|
||||
- Using ``fish_vi_key_bindings`` in combination with fish's ``--no-config`` mode works without locking up the shell (:issue:`9443`).
|
||||
- The history pager now uses more screen space, usually half the screen (:issue:`9458`)
|
||||
- Variables that were set while the locale was C (i.e. ASCII) will now properly be encoded if the locale is switched (:issue:`2613`, :issue:`9473`).
|
||||
- Escape during history search restores the original commandline again (regressed in 3.6.0).
|
||||
- Using ``--help`` on builtins now respects the $MANPAGER variable in preference to $PAGER (:issue:`9488`).
|
||||
|
||||
New or improved bindings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Improved prompts
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Completions
|
||||
^^^^^^^^^^^
|
||||
- Added completions for:
|
||||
- ``otool``
|
||||
- git's completion for ``git-foo``-style commands was fixed (:issue:`9457`)
|
||||
- File completion now offers ``../`` and ``./`` again (:issue:`9477`)
|
||||
- Completion for ``terraform`` now asks for a parameter after ``terraform init -backend-config``. (:issue:`9498`)
|
||||
|
||||
Improved terminal support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Other improvements
|
||||
------------------
|
||||
|
||||
|
||||
For distributors
|
||||
----------------
|
||||
- *Placeholder to fix Sphinx warning*
|
||||
|
||||
--------------
|
||||
|
||||
|
||||
fish 3.6.0 (released January 7, 2023)
|
||||
=====================================
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ Completion scripts are the most common contribution to fish, and they are very w
|
||||
In general, we'll take all well-written completion scripts for a command that is publically available.
|
||||
This means no private tools or personal scripts, and we do reserve the right to reject for other reasons.
|
||||
|
||||
Before you try to contribute them to fish, consider if the authors of the tool you are completing want to maintain the script instead.
|
||||
Often that makes more sense, specifically because they can add new options to the script immediately once they add them,
|
||||
and don't have to maintain one completion script for multiple versions. If the authors no longer wish to maintain the script,
|
||||
they can of course always contact the fish maintainers to hand it over, preferably by opening a PR.
|
||||
This isn't a requirement - if the authors don't want to maintain it, or you simply don't want to contact them,
|
||||
you can contribute your script to fish.
|
||||
|
||||
Completion scripts should
|
||||
|
||||
1. Use as few dependencies as possible - try to use fish's builtins like ``string`` instead of ``grep`` and ``awk``,
|
||||
@@ -27,8 +34,11 @@ Completion scripts should
|
||||
The shorter the description, the more likely it is that fish can use more columns.
|
||||
4. Function names should start with ``__fish``, and functions should be kept in the completion file unless they're used elsewhere.
|
||||
5. Run ``fish_indent`` on your script.
|
||||
6. Try not to use minor convenience features right after they are available in fish - we do try to keep completion scripts backportable.
|
||||
If something has a real impact on the correctness or performance, feel free to use it,
|
||||
but if it is just a shortcut, please leave it.
|
||||
|
||||
Put your completion script into share/completions/name-of-command.fish.
|
||||
Put your completion script into share/completions/name-of-command.fish. If you have multiple commands, you need multiple files.
|
||||
|
||||
If you want to add tests, you probably want to add a littlecheck test. See below for details.
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ and the rest of the family. fish includes features like syntax
|
||||
highlighting, autosuggest-as-you-type, and fancy tab completions that
|
||||
just work, with no configuration required.
|
||||
|
||||
For more on fish’s design philosophy, see the `design
|
||||
document <https://fishshell.com/docs/current/design.html>`__.
|
||||
For downloads, screenshots and more, go to https://fishshell.com/.
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
@@ -158,8 +158,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/html/ # Trailing slash is
|
||||
DESTINATION ${docdir} OPTIONAL)
|
||||
install(FILES CHANGELOG.rst DESTINATION ${docdir})
|
||||
|
||||
install(FILES share/lynx.lss DESTINATION ${rel_datadir}/fish/)
|
||||
|
||||
# These files are built by cmake/gettext.cmake, but using GETTEXT_PROCESS_PO_FILES's
|
||||
# INSTALL_DESTINATION leads to them being installed as ${lang}.gmo, not fish.mo
|
||||
# The ${languages} array comes from cmake/gettext.cmake
|
||||
|
||||
@@ -32,9 +32,23 @@ An abbreviation may match a literal word, or it may match a pattern given by a r
|
||||
|
||||
Combining these features, it is possible to create custom syntaxes, where a regular expression recognizes matching tokens, and the expansion function interprets them. See the `Examples`_ section.
|
||||
|
||||
Abbreviations may be added to :ref:`config.fish <configuration>`.
|
||||
.. versionchanged:: 3.6.0
|
||||
Previous versions of this allowed saving abbreviations in universal variables.
|
||||
That's no longer possible. Existing variables will still be imported and ``abbr --erase`` will also erase the variables.
|
||||
We recommend adding abbreviations to :ref:`config.fish <configuration>` by just adding the ``abbr --add`` command.
|
||||
When you run ``abbr``, you will see output like this
|
||||
|
||||
::
|
||||
|
||||
> abbr
|
||||
abbr -a -- foo bar # imported from a universal variable, see `help abbr`
|
||||
|
||||
In that case you should take the part before the ``#`` comment and save it in :ref:`config.fish <configuration>`,
|
||||
then you can run ``abbr --erase`` to remove the universal variable::
|
||||
|
||||
> abbr >> ~/.config/fish/config.fish
|
||||
> abbr --erase (abbr --list)
|
||||
|
||||
|
||||
"add" subcommand
|
||||
--------------------
|
||||
|
||||
@@ -163,6 +163,17 @@ The script should write any error messages to stdout, not stderr. It should retu
|
||||
|
||||
Fish ships with a ``_validate_int`` function that accepts a ``--min`` and ``--max`` flag. Let's say your command accepts a ``-m`` or ``--max`` flag and the minimum allowable value is zero and the maximum is 5. You would define the option like this: ``m/max=!_validate_int --min 0 --max 5``. The default if you just call ``_validate_int`` without those flags is to simply check that the value is a valid integer with no limits on the min or max value allowed.
|
||||
|
||||
Here are some examples of flag validations::
|
||||
|
||||
# validate that a path is a directory
|
||||
argparse 'p/path=!test -d "$_flag_value"' -- --path $__fish_config_dir
|
||||
# validate that a function does not exist
|
||||
argparse 'f/func=!not functions -q "$_flag_value"' -- -f alias
|
||||
# validate that a string matches a regex
|
||||
argparse 'c/color=!string match -rq \'^#?[0-9a-fA-F]{6}$\' "$_flag_value"' -- -c 'c0ffee'
|
||||
# validate with a validator function
|
||||
argparse 'n/num=!_validate_int --min 0 --max 99' -- --num 42
|
||||
|
||||
Example OPTION_SPECs
|
||||
--------------------
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ The **-h** or **--help** option displays help about using this command.
|
||||
|
||||
If the :envvar:`BROWSER` environment variable is set, it will be used to display the documentation.
|
||||
Otherwise, fish will search for a suitable browser.
|
||||
To use a different browser than as described above, one can set the :envvar:`fish_help_browser` variable.
|
||||
To use a different browser than as described above, you can set ``$fish_help_browser``
|
||||
This variable may be set as a list, where the first element is the browser command and the rest are browser options.
|
||||
|
||||
Example
|
||||
|
||||
@@ -51,8 +51,8 @@ The following scope control variable scope:
|
||||
|
||||
**-g** or **--global**
|
||||
Sets a globally-scoped variable.
|
||||
Global variables don't disappear and are available to all functions running in the same shell.
|
||||
They can even be modified.
|
||||
Global variables are available to all functions running in the same shell.
|
||||
They can be modified or erased.
|
||||
|
||||
These options modify how variables operate:
|
||||
|
||||
|
||||
@@ -59,6 +59,12 @@ Match Glob Examples
|
||||
>_ string match -i 'a??B' Axxb
|
||||
Axxb
|
||||
|
||||
>_ string match -- '-*' -h foo --version bar
|
||||
# To match things that look like options, we need a `--`
|
||||
# to tell string its options end there.
|
||||
-h
|
||||
--version
|
||||
|
||||
>_ echo 'ok?' | string match '*\?'
|
||||
ok?
|
||||
|
||||
@@ -91,6 +97,12 @@ Match Regex Examples
|
||||
cat4
|
||||
dog4
|
||||
|
||||
>_ string match -r -- '-.*' -h foo --version bar
|
||||
# To match things that look like options, we need a `--`
|
||||
# to tell string its options end there.
|
||||
-h
|
||||
--version
|
||||
|
||||
>_ string match -r '(\d\d?):(\d\d):(\d\d)' 2:34:56
|
||||
2:34:56
|
||||
2
|
||||
|
||||
@@ -27,7 +27,7 @@ Note that command substitutions in a case statement will be evaluated even if it
|
||||
Example
|
||||
-------
|
||||
|
||||
If the variable :envvar:`animal` contains the name of an animal, the following code would attempt to classify it:
|
||||
If the variable ``$animal`` contains the name of an animal, the following code would attempt to classify it:
|
||||
|
||||
::
|
||||
|
||||
|
||||
@@ -100,10 +100,19 @@ A script written in :command:`bash` would need a first line like this:
|
||||
|
||||
When the shell tells the kernel to execute the file, it will use the interpreter ``/bin/bash``.
|
||||
|
||||
For a script written in another language, just replace ``/bin/bash`` with the interpreter for that language (for example: ``/usr/bin/python`` for a python script, or ``/usr/local/bin/fish`` for a fish script).
|
||||
For a script written in another language, just replace ``/bin/bash`` with the interpreter for that language. For example: ``/usr/bin/python`` for a python script, or ``/usr/local/bin/fish`` for a fish script, if that is where you have them installed.
|
||||
|
||||
This line is only needed when scripts are executed without specifying the interpreter. For functions inside fish or when executing a script with ``fish /path/to/script``, a shebang is not required (but it doesn't hurt!).
|
||||
If you want to share your script with others, you might want to use :command:`env` to allow for the interpreter to be installed in other locations. For example::
|
||||
|
||||
#!/usr/bin/env fish
|
||||
echo Hello from fish $version
|
||||
|
||||
This will call ``env``, which then goes through :envvar:`PATH` to find a program called "fish". This makes it work, whether fish is installed in /usr/local/bin/fish or /usr/bin/fish or ~/.local/bin/fish, as long as that directory is in :envvar:`PATH`.
|
||||
|
||||
The shebang line is only used when scripts are executed without specifying the interpreter. For functions inside fish or when executing a script with ``fish /path/to/script``, a shebang is not required (but it doesn't hurt!).
|
||||
|
||||
When executing files without an interpreter, fish, like other shells, tries your system shell, typically /bin/sh. This is needed because some scripts are shipped without a shebang line.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
|
||||
@@ -235,7 +235,21 @@ The output of the former is displayed on the left and the latter's output on the
|
||||
Configurable greeting
|
||||
---------------------
|
||||
|
||||
When it is started interactively, fish tries to run the :doc:`fish_greeting <cmds/fish_greeting>` function. The default fish_greeting prints a simple greeting. You can change its text by changing the ``$fish_greeting`` variable.
|
||||
When it is started interactively, fish tries to run the :doc:`fish_greeting <cmds/fish_greeting>` function. The default fish_greeting prints a simple greeting. You can change its text by changing the ``$fish_greeting`` variable, for instance using a :ref:`universal variable <variables-universal>`::
|
||||
|
||||
set -U fish_greeting
|
||||
|
||||
or you can set it :ref:`globally <variables-scope>` in :ref:`config.fish <configuration>`::
|
||||
|
||||
set -g fish_greeting 'Hey, stranger!'
|
||||
|
||||
or you can script it by changing the function::
|
||||
|
||||
function fish_greeting
|
||||
random choice "Hello!" "Hi" "G'day" "Howdy"
|
||||
end
|
||||
|
||||
save this in config.fish or :ref:`a function file <syntax-function-autoloading>`. You can also use :doc:`funced <cmds/funced>` and :doc:`funcsave <cmds/funcsave>` to edit it easily.
|
||||
|
||||
.. _private-mode:
|
||||
|
||||
@@ -349,6 +363,8 @@ To enable emacs mode, use ``fish_default_key_bindings``. This is also the defaul
|
||||
|
||||
- :kbd:`Control`\ +\ :kbd:`K` deletes from the cursor to the end of line (moving it to the :ref:`killring`).
|
||||
|
||||
- :kbd:`Escape` and :kbd:`Control`\ +\ :kbd:`G` cancel the current operation. Immediately after an unambiguous completion this undoes it.
|
||||
|
||||
- :kbd:`Alt`\ +\ :kbd:`C` capitalizes the current word.
|
||||
|
||||
- :kbd:`Alt`\ +\ :kbd:`U` makes the current word uppercase.
|
||||
@@ -435,6 +451,10 @@ Command mode is also known as normal mode.
|
||||
|
||||
- :kbd:`Shift`\ +\ :kbd:`A` enters :ref:`insert mode <vi-mode-insert>` at the end of the line.
|
||||
|
||||
- :kbd:`o` inserts a new line under the current one and enters :ref:`insert mode <vi-mode-insert>`
|
||||
|
||||
- :kbd:`O` (capital-"o") inserts a new line above the current one and enters :ref:`insert mode <vi-mode-insert>`
|
||||
|
||||
- :kbd:`0` (zero) moves the cursor to beginning of line (remaining in command mode).
|
||||
|
||||
- :kbd:`d`\ +\ :kbd:`d` deletes the current line and moves it to the :ref:`killring`.
|
||||
@@ -444,6 +464,7 @@ Command mode is also known as normal mode.
|
||||
- :kbd:`p` pastes text from the :ref:`killring`.
|
||||
|
||||
- :kbd:`u` undoes the most recent edit of the command line.
|
||||
- :kbd:`Control`\ +\ :kbd:`R` redoes the most recent edit.
|
||||
|
||||
- :kbd:`[` and :kbd:`]` search the command history for the previous/next token containing the token under the cursor before the search was started. See the :ref:`history <history-search>` section for more information on history searching.
|
||||
|
||||
@@ -451,6 +472,10 @@ Command mode is also known as normal mode.
|
||||
|
||||
- :kbd:`Backspace` moves the cursor left.
|
||||
|
||||
- :kbd:`g` / :kbd:`G` moves the cursor to the beginning/end of the commandline, respectively.
|
||||
|
||||
- :kbd:`:q` exits fish.
|
||||
|
||||
.. _vi-mode-insert:
|
||||
|
||||
Insert mode
|
||||
@@ -503,7 +528,18 @@ In addition to the standard bindings listed here, you can also define your own w
|
||||
|
||||
Put ``bind`` statements into :ref:`config.fish <configuration>` or a function called ``fish_user_key_bindings``.
|
||||
|
||||
The key sequence (the ``\cc``) here depends on your setup, in particular the terminal. To find out what the terminal sends use :doc:`fish_key_reader <cmds/fish_key_reader>`::
|
||||
If you change your mind on a binding and want to go back to fish's default, you can simply erase it again::
|
||||
|
||||
bind --erase \cc
|
||||
|
||||
Fish remembers its preset bindings and so it will take effect again. This saves you from having to remember what it was before and add it again yourself.
|
||||
|
||||
Key sequences
|
||||
"""""""""""""
|
||||
|
||||
The terminal tells fish which keys you pressed by sending some sequences of bytes to describe that key. For some keys, this is easy - pressing :kbd:`a` simply means the terminal sends "a". In others it's more complicated and terminals disagree on which they send.
|
||||
|
||||
In these cases, :doc:`fish_key_reader <cmds/fish_key_reader>` can tell you how to write the key sequence for your terminal. Just start it and press the keys you are interested in::
|
||||
|
||||
> fish_key_reader # pressing control-c
|
||||
Press a key:
|
||||
|
||||
@@ -69,30 +69,31 @@ Here we define some of the terms used on this page and throughout the rest of th
|
||||
Quotes
|
||||
------
|
||||
|
||||
Sometimes features like :ref:`parameter expansion <expand>` and :ref:`character escapes <escapes>` get in the way. When that happens, you can use quotes, either single (``'``) or double (``"``). Between single quotes, fish performs no expansions. Between double quotes, fish only performs :ref:`variable expansion <expand-variable>`. No other kind of expansion (including :ref:`brace expansion <expand-brace>` or parameter expansion) is performed, and escape sequences (for example, ``\n``) are ignored. Within quotes, whitespace is not used to separate arguments, allowing quoted arguments to contain spaces.
|
||||
Sometimes you want to give a command an argument that contains characters special to fish, like spaces or ``$`` or ``*``. To do that, you can use quotes::
|
||||
|
||||
rm "my file.txt"
|
||||
|
||||
to remove a file called ``my file.txt`` instead of trying to remove two files, ``my`` and ``file.txt``.
|
||||
|
||||
Fish understands two kinds of quotes: Single (``'``) and double (``"``), and both work slightly differently.
|
||||
|
||||
Between single quotes, fish performs no expansions. Between double quotes, fish only performs :ref:`variable expansion <expand-variable>` and :ref:`command substitution <expand-command-substitution>` in the ``$(command)``. No other kind of expansion (including :ref:`brace expansion <expand-brace>` or parameter expansion) is performed, and escape sequences (for example, ``\n``) are ignored. Within quotes, whitespace is not used to separate arguments, allowing quoted arguments to contain spaces.
|
||||
|
||||
The only meaningful escape sequences in single quotes are ``\'``, which escapes a single quote and ``\\``, which escapes the backslash symbol. The only meaningful escapes in double quotes are ``\"``, which escapes a double quote, ``\$``, which escapes a dollar character, ``\`` followed by a newline, which deletes the backslash and the newline, and ``\\``, which escapes the backslash symbol.
|
||||
|
||||
Single quotes have no special meaning within double quotes and vice versa.
|
||||
|
||||
Example::
|
||||
|
||||
rm "cumbersome filename.txt"
|
||||
|
||||
removes the file ``cumbersome filename.txt``, while
|
||||
|
||||
::
|
||||
|
||||
rm cumbersome filename.txt
|
||||
|
||||
removes two files, ``cumbersome`` and ``filename.txt``.
|
||||
|
||||
Another example::
|
||||
More examples::
|
||||
|
||||
grep 'enabled)$' foo.txt
|
||||
|
||||
searches for lines ending in ``enabled)`` in ``foo.txt`` (the ``$`` is special to ``grep``: it matches the end of the line).
|
||||
|
||||
::
|
||||
apt install "postgres-*"
|
||||
|
||||
installs all packages with a name starting with "postgres-", instead of looking through the current directory for files named "postgres-something".
|
||||
|
||||
.. _escapes:
|
||||
|
||||
Escaping Characters
|
||||
@@ -241,7 +242,7 @@ As a convenience, the pipe ``&|`` redirects both stdout and stderr to the same p
|
||||
Job control
|
||||
-----------
|
||||
|
||||
When you start a job in fish, fish itself will pause, and give control of the terminal to the program just started. Sometimes, you want to continue using the commandline, and have the job run in the background. To create a background job, append an \& (ampersand) to your command. This will tell fish to run the job in the background. Background jobs are very useful when running programs that have a graphical user interface.
|
||||
When you start a job in fish, fish itself will pause, and give control of the terminal to the program just started. Sometimes, you want to continue using the commandline, and have the job run in the background. To create a background job, append an ``&`` (ampersand) to your command. This will tell fish to run the job in the background. Background jobs are very useful when running programs that have a graphical user interface.
|
||||
|
||||
Example::
|
||||
|
||||
@@ -377,32 +378,81 @@ Comments can also appear after a line like so::
|
||||
Conditions
|
||||
----------
|
||||
|
||||
Fish has some builtins that let you execute commands only if a specific criterion is met: :doc:`if <cmds/if>`, :doc:`switch <cmds/switch>`, :doc:`and <cmds/and>` and :doc:`or <cmds/or>`, and also the familiar :ref:`&&/|| <tut-combiners>` syntax.
|
||||
Fish has some builtins that let you execute commands only if a specific criterion is met: :doc:`if <cmds/if>`, :doc:`switch <cmds/switch>`, :doc:`and <cmds/and>` and :doc:`or <cmds/or>`, and also the familiar :ref:`&&/|| <syntax-combiners>` syntax.
|
||||
|
||||
The :doc:`switch <cmds/switch>` command is used to execute one of possibly many blocks of commands depending on the value of a string. See the documentation for :doc:`switch <cmds/switch>` for more information.
|
||||
.. _syntax-if:
|
||||
|
||||
The other conditionals use the :ref:`exit status <variables-status>` of a command to decide if a command or a block of commands should be executed.
|
||||
The ``if`` statement
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Unlike programming languages you might know, :doc:`if <cmds/if>` doesn't take a *condition*, it takes a *command*. If that command returned a successful :ref:`exit status <variables-status>` (that's 0), the ``if`` branch is taken, otherwise the :doc:`else <cmds/else>` branch.
|
||||
The :doc:`if <cmds/if>` statement runs a block of commands if the condition was true.
|
||||
|
||||
To check a condition, there is the :doc:`test <cmds/test>` command::
|
||||
Like other shells, but unlike typical programming languages you might know, the condition here is a *command*. Fish runs it, and if it returns a true :ref:`exit status <variables-status>` (that's 0), the if-block is run. For example::
|
||||
|
||||
if test 5 -gt 2
|
||||
echo Yes, five is greater than two
|
||||
if test -e /etc/os-release
|
||||
cat /etc/os-release
|
||||
end
|
||||
|
||||
Some examples::
|
||||
This uses the :doc:`test <cmds/test>` command to see if the file /etc/os-release exists. If it does, it runs ``cat``, which prints it on the screen.
|
||||
|
||||
Unlike other shells, the condition command just ends after the first job, there is no ``then`` here. Combiners like ``and`` and ``or`` extend the condition.
|
||||
|
||||
``if`` is commonly used with the :doc:`test <cmds/test>` command that can check conditions.::
|
||||
|
||||
if test 5 -gt 2
|
||||
echo "Yes, 5 is greater than 2"
|
||||
end
|
||||
|
||||
``if`` can also take ``else if`` clauses with additional conditions and an :doc:`else <cmds/else>` clause that is executed when everything else was false::
|
||||
|
||||
if test "$number" -gt 10
|
||||
echo Your number was greater than 10
|
||||
else if test "$number" -gt 5
|
||||
echo Your number was greater than 5
|
||||
else if test "$number" -gt 1
|
||||
echo Your number was greater than 1
|
||||
else
|
||||
echo Your number was smaller or equal to 1
|
||||
end
|
||||
|
||||
The :doc:`not <cmds/not>` keyword can be used to invert the status::
|
||||
|
||||
# Just see if the file contains the string "fish" anywhere.
|
||||
# This executes the `grep` command, which searches for a string,
|
||||
# and if it finds it returns a status of 0.
|
||||
# The `not` then turns 0 into 1 or anything else into 0.
|
||||
# The `-q` switch stops it from printing any matches.
|
||||
if grep -q fish myanimals
|
||||
echo "You have fish!"
|
||||
else
|
||||
if not grep -q fish myanimals
|
||||
echo "You don't have fish!"
|
||||
else
|
||||
echo "You have fish!"
|
||||
end
|
||||
|
||||
The ``switch`` statement
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The :doc:`switch <cmds/switch>` command is used to execute one of possibly many blocks of commands depending on the value of a string. It can take multiple :doc:`case <cmds/case>` blocks that are executed when the string matches. They can take :ref:`wildcards <expand-wildcard>`. For example::
|
||||
|
||||
switch (uname)
|
||||
case Linux
|
||||
echo Hi Tux!
|
||||
case Darwin
|
||||
echo Hi Hexley!
|
||||
case DragonFly '*BSD'
|
||||
echo Hi Beastie! # this also works for FreeBSD and NetBSD
|
||||
case '*'
|
||||
echo Hi, stranger!
|
||||
end
|
||||
|
||||
Unlike other shells or programming languages, there is no fallthrough - the first matching ``case`` block is executed and then control jumps out of the ``switch``.
|
||||
|
||||
.. _syntax-combiners:
|
||||
|
||||
Combiners (``and`` / ``or`` / ``&&`` / ``||``)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For simple checks, you can use combiners. :doc:`and <cmds/and>` or ``&&`` run the second command if the first succeeded, while :doc:`or <cmds/or>` or ``||`` run it if the first failed. For example::
|
||||
|
||||
# $XDG_CONFIG_HOME is a standard place to store configuration.
|
||||
# If it's not set applications should use ~/.config.
|
||||
set -q XDG_CONFIG_HOME; and set -l configdir $XDG_CONFIG_HOME
|
||||
@@ -422,7 +472,7 @@ and::
|
||||
echo 'How did I get here? This should be impossible'
|
||||
end
|
||||
|
||||
These do essentially the same thing, but the former takes 2 seconds longer because the ``sleep`` always needs to run. So, in cases like these, the ordering is quite important for performance.
|
||||
These do essentially the same thing, but the former takes 2 seconds longer because the ``sleep`` always needs to run.
|
||||
|
||||
Or you can have a case where it is necessary to stop early::
|
||||
|
||||
@@ -430,7 +480,20 @@ Or you can have a case where it is necessary to stop early::
|
||||
|
||||
If this went on after seeing that the command "foo" doesn't exist, it would try to run ``foo`` and error because it wasn't found!
|
||||
|
||||
For more, see the documentation for the builtins or the :ref:`Conditionals <tut-conditionals>` section of the tutorial.
|
||||
Combiners really just execute step-by-step, so it isn't recommended to build longer chains of them because they might do something you don't want. Consider::
|
||||
|
||||
test -e /etc/my.config
|
||||
or echo "OH NO WE NEED A CONFIG FILE"
|
||||
and return 1
|
||||
|
||||
This will execute ``return 1`` also if the ``test`` succeeded. This is because fish runs ``test -e /etc/my.config``, sets $status to 0, then skips the ``echo``, keeps $status at 0, and then executes the ``return 1`` because $status is still 0.
|
||||
|
||||
So if you have more complex conditions or want to run multiple things after something failed, consider using an :ref:`if <syntax-if>`. Here that would be::
|
||||
|
||||
if not test -e /etc/my.config
|
||||
echo "OH NO WE NEED A CONFIG FILE"
|
||||
return 1
|
||||
end
|
||||
|
||||
.. _syntax-loops-and-blocks:
|
||||
|
||||
@@ -638,17 +701,21 @@ When using this feature together with list brackets, the brackets will be used f
|
||||
Command substitution
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The output of a command (or an entire :ref:`pipeline <pipes>`) can be used as the arguments to another command.
|
||||
A ``command substitution`` is an expansion that uses the *output* of a command as the arguments to another. For example::
|
||||
|
||||
When you write a command in parentheses like ``outercommand (innercommand)``, fish first runs ``innercommand``, and then uses each line of its output as a separate argument to ``outercommand``, which will then be executed. Unlike other shells, the value of ``$IFS`` is not used [#]_, fish splits on newlines.
|
||||
echo (pwd)
|
||||
|
||||
A command substitution can have a dollar sign before the opening parenthesis like ``outercommand $(innercommand)``. This variant is also allowed inside double quotes. When using double quotes, the command output is not split up by lines, but trailing empty lines are still removed.
|
||||
This executes the :doc:`pwd <cmds/pwd>` command, takes its output (more specifically what it wrote to the standard output "stdout" stream) and uses it as arguments to :doc:`echo <cmds/echo>`. So the inner command (the ``pwd``) is run first and has to complete before the outer command can even be started.
|
||||
|
||||
If the inner command prints multiple lines, fish will use each separate line as a separate argument to the outer command. Unlike other shells, the value of ``$IFS`` is not used [#]_, fish splits on newlines.
|
||||
|
||||
A command substitution can also be spelled with a dollar sign like ``outercommand $(innercommand)``. This variant is also allowed inside double quotes. When using double quotes, the command output is not split up by lines, but trailing empty lines are still removed.
|
||||
|
||||
If the output is piped to :doc:`string split or string split0 <cmds/string-split>` as the last step, those splits are used as they appear instead of splitting lines.
|
||||
|
||||
The exit status of the last run command substitution is available in the :ref:`status <variables-status>` variable if the substitution happens in the context of a :doc:`set <cmds/set>` command (so ``if set -l (something)`` checks if ``something`` returned true).
|
||||
|
||||
To use only some lines of the output, refer to :ref:`index range expansion <expand-index-range>`.
|
||||
To use only some lines of the output, refer to :ref:`slices <expand-slices>`.
|
||||
|
||||
Examples::
|
||||
|
||||
@@ -666,7 +733,6 @@ Examples::
|
||||
# Set ``$data`` to the contents of data, splitting on NUL-bytes.
|
||||
set data (cat data | string split0)
|
||||
|
||||
|
||||
Sometimes you want to pass the output of a command to another command that only accepts files. If it's just one file, you can usually just pass it via a pipe, like::
|
||||
|
||||
grep fish myanimallist1 | wc -l
|
||||
@@ -791,10 +857,10 @@ This can be quite useful. For example, if you want to go through all the files i
|
||||
|
||||
Because :envvar:`PATH` is a list, this expands to all the files in all the directories in it. And if there are no directories in :envvar:`PATH`, the right answer here is to expand to no files.
|
||||
|
||||
.. _expand-index-range:
|
||||
.. _expand-slices:
|
||||
|
||||
Index range expansion
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Slices
|
||||
^^^^^^
|
||||
|
||||
Sometimes it's necessary to access only some of the elements of a :ref:`list <variables-lists>` (all fish variables are lists), or some of the lines a :ref:`command substitution <expand-command-substitution>` outputs. Both are possible in fish by writing a set of indices in brackets, like::
|
||||
|
||||
@@ -814,7 +880,7 @@ If a list has 5 elements the indices go from 1 to 5, so a range of ``2..16`` wil
|
||||
If the end is negative the range always goes up, so ``2..-2`` will go from element 2 to 4, and ``2..-16`` won't go anywhere because there is no way to go from the second element to one that doesn't exist, while going up.
|
||||
If the start is negative the range always goes down, so ``-2..1`` will go from element 4 to 1, and ``-16..2`` won't go anywhere because there is no way to go from an element that doesn't exist to the second element, while going down.
|
||||
|
||||
A missing starting index in a range defaults to 1. This is allowed if the range is the first index expression of the sequence. Similarly, a missing ending index, defaulting to -1 is allowed for the last index range in the sequence.
|
||||
A missing starting index in a range defaults to 1. This is allowed if the range is the first index expression of the sequence. Similarly, a missing ending index, defaulting to -1 is allowed for the last index in the sequence.
|
||||
|
||||
Multiple ranges are also possible, separated with a space.
|
||||
|
||||
@@ -944,8 +1010,8 @@ Variable Scope
|
||||
|
||||
There are four kinds of variables in fish: universal, global, function and local variables.
|
||||
|
||||
- Universal variables are shared between all fish sessions a user is running on one computer.
|
||||
- Global variables are specific to the current fish session, and will never be erased unless explicitly requested by using ``set -e``.
|
||||
- Universal variables are shared between all fish sessions a user is running on one computer. They are stored on disk and persist even after reboot.
|
||||
- Global variables are specific to the current fish session. They can be erased by explicitly requesting ``set -e``.
|
||||
- Function variables are specific to the currently executing function. They are erased ("go out of scope") when the current function ends. Outside of a function, they don't go out of scope.
|
||||
- Local variables are specific to the current block of commands, and automatically erased when a specific block goes out of scope. A block of commands is a series of commands that begins with one of the commands ``for``, ``while`` , ``if``, ``function``, ``begin`` or ``switch``, and ends with the command ``end``. Outside of a block, this is the same as the function scope.
|
||||
|
||||
@@ -1021,6 +1087,24 @@ Here is an example of local vs function-scoped variables::
|
||||
# Will output Sir Terry's wisdom.
|
||||
end
|
||||
|
||||
When a function calls another, local variables aren't visible::
|
||||
|
||||
function shiver
|
||||
set phrase 'Shiver me timbers'
|
||||
end
|
||||
|
||||
function avast
|
||||
set --local phrase 'Avast, mateys'
|
||||
# Calling the shiver function here can not
|
||||
# change any variables in the local scope
|
||||
# so phrase remains as we set it here.
|
||||
shiver
|
||||
echo $phrase
|
||||
end
|
||||
avast
|
||||
|
||||
# Outputs "Avast, mateys"
|
||||
|
||||
When in doubt, use function-scoped variables. When you need to make a variable accessible everywhere, make it global. When you need to persistently store configuration, make it universal. When you want to use a variable only in a short block, make it local.
|
||||
|
||||
.. _variables-override:
|
||||
@@ -1056,8 +1140,8 @@ This syntax is supported since fish 3.1.
|
||||
|
||||
.. _variables-universal:
|
||||
|
||||
More on universal variables
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Universal Variables
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Universal variables are variables that are shared between all the user's fish sessions on the computer. Fish stores many of its configuration options as universal variables. This means that in order to change fish settings, all you have to do is change the variable value once, and it will be automatically updated for all sessions, and preserved across computer reboots and login/logout.
|
||||
|
||||
@@ -1067,30 +1151,6 @@ To see universal variables in action, start two fish sessions side by side, and
|
||||
|
||||
Do not append to universal variables in :ref:`config.fish <configuration>`, because these variables will then get longer with each new shell instance. Instead, simply set them once at the command line.
|
||||
|
||||
.. _variables-functions:
|
||||
|
||||
Variable scope for functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When calling a function, all current local variables temporarily disappear. This shadowing of the local scope is needed since the variable namespace would become cluttered, making it very easy to accidentally overwrite variables from another function.
|
||||
|
||||
For example::
|
||||
|
||||
function shiver
|
||||
set phrase 'Shiver me timbers'
|
||||
end
|
||||
|
||||
function avast
|
||||
set --local phrase 'Avast, mateys'
|
||||
# Calling the shiver function here can not
|
||||
# change any variables in the local scope
|
||||
shiver
|
||||
echo $phrase
|
||||
end
|
||||
avast
|
||||
|
||||
# Outputs "Avast, mateys"
|
||||
|
||||
.. _variables-export:
|
||||
|
||||
Exporting variables
|
||||
@@ -1175,7 +1235,7 @@ If you specify a negative index when expanding or assigning to a list variable,
|
||||
orange
|
||||
apple
|
||||
|
||||
As you see, you can use a range of indices, see :ref:`index range expansion <expand-index-range>` for details.
|
||||
As you see, you can use a range of indices, see :ref:`slices <expand-slices>` for details.
|
||||
|
||||
All lists are one-dimensional and can't contain other lists, although it is possible to fake nested lists using dereferencing - see :ref:`variable expansion <expand-variable>`.
|
||||
|
||||
@@ -1323,6 +1383,16 @@ You can change the settings of fish by changing the values of certain variables.
|
||||
|
||||
A number of variable starting with the prefixes ``fish_color`` and ``fish_pager_color``. See :ref:`Variables for changing highlighting colors <variables-color>` for more information.
|
||||
|
||||
.. envvar:: fish_term24bit
|
||||
|
||||
If this is set to 1, fish will assume the terminal understands 24-bit RGB color sequences, and won't translate them to the 256 or 16 color palette.
|
||||
This is often detected automatically.
|
||||
|
||||
.. envvar:: fish_term256
|
||||
|
||||
If this is set to 1, fish will assume the terminal understands 256 colors, and won't translate matching colors down to the 16 color palette.
|
||||
This is usually autodetected.
|
||||
|
||||
.. envvar:: fish_ambiguous_width
|
||||
|
||||
controls the computed width of ambiguous-width characters. This should be set to 1 if your terminal renders these characters as single-width (typical), or 2 if double-width.
|
||||
|
||||
@@ -169,7 +169,7 @@ div.warning {
|
||||
border: 1px solid #f66;
|
||||
}
|
||||
|
||||
div.admonition {
|
||||
div.admonition, div.versionchanged {
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ p.admonition-title::after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
p.admonition-title, span.versionmodified {
|
||||
display: inline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -1,92 +1,78 @@
|
||||
set -l subcommands add-blob alias-env attach-disk blobs cancel-task clean-up \
|
||||
cloud-check cloud-config config configs cpi-config create-env create-release \
|
||||
delete-config delete-deployment delete-disk delete-env delete-release \
|
||||
delete-snapshot delete-snapshots delete-stemcell delete-vm deploy deployment \
|
||||
deployments diff-config disks environment environments errands event events \
|
||||
export-release finalize-release generate-job generate-package help ignore \
|
||||
init-release inspect-release instances interpolate locks log-in log-out logs \
|
||||
manifest orphan-disk recreate releases remove-blob repack-stemcell \
|
||||
reset-release restart run-errand runtime-config scp snapshots ssh start \
|
||||
stemcells stop sync-blobs take-snapshot task tasks unignore \
|
||||
update-cloud-config update-config update-cpi-config update-resurrection \
|
||||
update-runtime-config upload-blobs upload-release upload-stemcell variables \
|
||||
vendor-package vms
|
||||
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a add-blob -d "Add blob"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a alias-env -d "Alias environment to save URL and CA certificate"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a attach-disk -d "Attaches disk to an instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a blobs -d "List blobs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a cancel-task -d "Cancel task at its next checkpoint"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a clean-up -d "Clean up releases, stemcells, disks, etc."
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a cloud-check -d "Cloud consistency check and interactive repair"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a cloud-config -d "Show current cloud config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a config -d "Show current config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a configs -d "List configs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a cpi-config -d "Show current CPI config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a create-env -d "Create or update BOSH environment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a create-release -d "Create release"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-config -d "Delete config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-deployment -d "Delete deployment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-disk -d "Delete disk"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-env -d "Delete BOSH environment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-release -d "Delete release"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-snapshot -d "Delete snapshot"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-snapshots -d "Delete all snapshots in a deployment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-stemcell -d "Delete stemcell"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a delete-vm -d "Delete VM"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a deploy -d "Update deployment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a deployment -d "Show deployment information"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a deployments -d "List deployments"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a diff-config -d "Diff two configs by ID"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a disks -d "List disks"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a environment -d "Show environment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a environments -d "List environments"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a errands -d "List errands"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a event -d "Show event details"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a events -d "List events"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a export-release -d "Export the compiled release to a tarball"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a finalize-release -d "Create final release from dev release tarball"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a generate-job -d "Generate job"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a generate-package -d "Generate package"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a help -d "Show this help message"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a ignore -d "Ignore an instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a init-release -d "Initialize release"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a inspect-release -d "List release contents such as jobs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a instances -d "List all instances in a deployment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a interpolate -d "Interpolates variables into a manifest"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a locks -d "List current locks"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a log-in -d "Log in"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a log-out -d "Log out"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a logs -d "Fetch logs from instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a manifest -d "Show deployment manifest"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a orphan-disk -d "Orphan disk"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a recreate -d "Recreate instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a releases -d "List releases"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a remove-blob -d "Remove blob"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a repack-stemcell -d "Repack stemcell"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a reset-release -d "Reset release"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a restart -d "Restart instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a run-errand -d "Run errand"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a runtime-config -d "Show current runtime config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a scp -d "SCP to/from instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a snapshots -d "List snapshots"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a ssh -d "SSH into instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a start -d "Start instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a stemcells -d "List stemcells"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a stop -d "Stop instance(s)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a sync-blobs -d "Sync blobs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a take-snapshot -d "Take snapshot"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a task -d "Show task status and start tracking its output"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a tasks -d "List running or recent tasks"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a unignore -d "Unignore an instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a update-cloud-config -d "Update current cloud config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a update-config -d "Update config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a update-cpi-config -d "Update current CPI config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a update-resurrection -d "Enable/disable resurrection"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a update-runtime-config -d "Update current runtime config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a upload-blobs -d "Upload blobs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a upload-release -d "Upload release"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a upload-stemcell -d "Upload stemcell"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a variables -d "List variables"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a vendor-package -d "Vendor package"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a vms -d "List all VMs in all deployments"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a add-blob -d "Add blob"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a alias-env -d "Alias environment to save URL and CA certificate"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a attach-disk -d "Attaches disk to an instance"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a blobs -d "List blobs"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a cancel-task -d "Cancel task at its next checkpoint"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a clean-up -d "Clean up releases, stemcells, disks, etc."
|
||||
complete -f -n __fish_use_subcommand -c bosh -a cloud-check -d "Cloud consistency check and interactive repair"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a cloud-config -d "Show current cloud config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a config -d "Show current config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a configs -d "List configs"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a cpi-config -d "Show current CPI config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a create-env -d "Create or update BOSH environment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a create-release -d "Create release"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-config -d "Delete config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-deployment -d "Delete deployment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-disk -d "Delete disk"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-env -d "Delete BOSH environment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-release -d "Delete release"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-snapshot -d "Delete snapshot"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-snapshots -d "Delete all snapshots in a deployment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-stemcell -d "Delete stemcell"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a delete-vm -d "Delete VM"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a deploy -d "Update deployment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a deployment -d "Show deployment information"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a deployments -d "List deployments"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a diff-config -d "Diff two configs by ID"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a disks -d "List disks"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a environment -d "Show environment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a environments -d "List environments"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a errands -d "List errands"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a event -d "Show event details"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a events -d "List events"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a export-release -d "Export the compiled release to a tarball"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a finalize-release -d "Create final release from dev release tarball"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a generate-job -d "Generate job"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a generate-package -d "Generate package"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a help -d "Show this help message"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a ignore -d "Ignore an instance"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a init-release -d "Initialize release"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a inspect-release -d "List release contents such as jobs"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a instances -d "List all instances in a deployment"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a interpolate -d "Interpolates variables into a manifest"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a locks -d "List current locks"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a log-in -d "Log in"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a log-out -d "Log out"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a logs -d "Fetch logs from instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a manifest -d "Show deployment manifest"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a orphan-disk -d "Orphan disk"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a recreate -d "Recreate instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a releases -d "List releases"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a remove-blob -d "Remove blob"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a repack-stemcell -d "Repack stemcell"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a reset-release -d "Reset release"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a restart -d "Restart instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a run-errand -d "Run errand"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a runtime-config -d "Show current runtime config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a scp -d "SCP to/from instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a snapshots -d "List snapshots"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a ssh -d "SSH into instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a start -d "Start instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a stemcells -d "List stemcells"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a stop -d "Stop instance(s)"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a sync-blobs -d "Sync blobs"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a take-snapshot -d "Take snapshot"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a task -d "Show task status and start tracking its output"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a tasks -d "List running or recent tasks"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a unignore -d "Unignore an instance"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a update-cloud-config -d "Update current cloud config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a update-config -d "Update config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a update-cpi-config -d "Update current CPI config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a update-resurrection -d "Enable/disable resurrection"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a update-runtime-config -d "Update current runtime config"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a upload-blobs -d "Upload blobs"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a upload-release -d "Upload release"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a upload-stemcell -d "Upload stemcell"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a variables -d "List variables"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a vendor-package -d "Vendor package"
|
||||
complete -f -n __fish_use_subcommand -c bosh -a vms -d "List all VMs in all deployments"
|
||||
|
||||
@@ -1,208 +1,168 @@
|
||||
set -l subcommands help version login logout passwd target api auth apps app \
|
||||
push scale delete rename start stop restart restage restart-app-instance \
|
||||
run-task tasks terminate-task events files logs env set-env unset-env stacks \
|
||||
stack copy-source create-app-manifest get-health-check set-health-check \
|
||||
enable-ssh disable-ssh ssh-enabled ssh marketplace services service \
|
||||
create-service update-service delete-service rename-service \
|
||||
create-service-key service-keys service-key delete-service-key bind-service \
|
||||
unbind-service bind-route-service unbind-route-service \
|
||||
create-user-provided-service update-user-provided-service orgs org \
|
||||
create-org delete-org rename-org spaces space create-space delete-space \
|
||||
rename-space allow-space-ssh disallow-space-ssh space-ssh-allowed domains \
|
||||
create-domain delete-domain create-shared-domain delete-shared-domain \
|
||||
router-groups routes create-route check-route map-route unmap-route \
|
||||
delete-route delete-orphaned-routes network-policies add-network-policy \
|
||||
remove-network-policy buildpacks create-buildpack update-buildpack \
|
||||
rename-buildpack delete-buildpack create-user delete-user org-users \
|
||||
set-org-role unset-org-role space-users set-space-role unset-space-role \
|
||||
quotas quota set-quota create-quota delete-quota update-quota \
|
||||
share-private-domain unshare-private-domain space-quotas space-quota \
|
||||
create-space-quota update-space-quota delete-space-quota set-space-quota \
|
||||
unset-space-quota service-auth-tokens create-service-auth-token \
|
||||
update-service-auth-token delete-service-auth-token service-brokers \
|
||||
create-service-broker update-service-broker delete-service-broker \
|
||||
rename-service-broker migrate-service-instances purge-service-offering \
|
||||
purge-service-instance service-access enable-service-access \
|
||||
disable-service-access security-group security-groups create-security-group \
|
||||
update-security-group delete-security-group bind-security-group \
|
||||
unbind-security-group bind-staging-security-group staging-security-groups \
|
||||
unbind-staging-security-group bind-running-security-group \
|
||||
running-security-groups unbind-running-security-group \
|
||||
running-environment-variable-group staging-environment-variable-group \
|
||||
set-staging-environment-variable-group set-running-environment-variable-group \
|
||||
isolation-segments create-isolation-segment delete-isolation-segment \
|
||||
enable-org-isolation disable-org-isolation set-org-default-isolation-segment \
|
||||
reset-org-default-isolation-segment set-space-isolation-segment \
|
||||
reset-space-isolation-segment feature-flags feature-flag enable-feature-flag \
|
||||
disable-feature-flag curl config oauth-token ssh-code add-plugin-repo \
|
||||
remove-plugin-repo list-plugin-repos repo-plugins plugins install-plugin \
|
||||
uninstall-plugin
|
||||
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a help -d "Show help"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a version -d "Print the version"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a login -d "Log user in"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a logout -d "Log user out"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a passwd -d "Change user password"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a target -d "Set or view the targeted org or space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a api -d "Set or view target api url"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a auth -d "Authenticate user non-interactively"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a apps -d "List all apps in the target space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a app -d "Display health and status for an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a push -d "Push a new app or sync changes to an existing app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a scale -d "Change or view the instance count, disk space limit, and memory limit for an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete -d "Delete an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename -d "Rename an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a start -d "Start an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a stop -d "Stop an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a restart -d "Stop all instances of the app, then start them again. This causes downtime."
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a restage -d "Recreate the app's executable artifact using the latest pushed app files and the latest environment (variables, service bindings, buildpack, stack, etc.)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a restart-app-instance -d "Terminate, then restart an app instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a run-task -d "Run a one-off task on an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a tasks -d "List tasks of an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a terminate-task -d "Terminate a running task of an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a events -d "Show recent app events"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a files -d "Print out a list of files in a directory or the contents of a specific file of an app running on the DEA backend"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a logs -d "Tail or show recent logs for an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a env -d "Show all env variables for an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-env -d "Set an env variable for an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unset-env -d "Remove an env variable"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a stacks -d "List all stacks (a stack is a pre-built file system, including an operating system, that can run apps)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a stack -d "Show information for a stack (a stack is a pre-built file system, including an operating system, that can run apps)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a copy-source -d "Copies the source code of an application to another existing application (and restarts that application)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-app-manifest -d "Create an app manifest for an app that has been pushed successfully"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a get-health-check -d "Show the type of health check performed on an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-health-check -d "Change type of health check performed on an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a enable-ssh -d "Enable ssh for the application"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a disable-ssh -d "Disable ssh for the application"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a ssh-enabled -d "Reports whether SSH is enabled on an application container instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a ssh -d "SSH to an application container instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a marketplace -d "List available offerings in the marketplace"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a services -d "List all service instances in the target space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service -d "Show service instance info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-service -d "Create a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-service -d "Update a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-service -d "Delete a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename-service -d "Rename a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-service-key -d "Create key for a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service-keys -d "List keys for a service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service-key -d "Show service key info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-service-key -d "Delete a service key"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a bind-service -d "Bind a service instance to an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unbind-service -d "Unbind a service instance from an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a bind-route-service -d "Bind a service instance to an HTTP route"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unbind-route-service -d "Unbind a service instance from an HTTP route"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-user-provided-service -d "Make a user-provided service instance available to CF apps"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-user-provided-service -d "Update user-provided service instance"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a orgs -d "List all orgs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a org -d "Show org info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-org -d "Create an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-org -d "Delete an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename-org -d "Rename an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a spaces -d "List all spaces in an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a space -d "Show space info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-space -d "Create a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-space -d "Delete a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename-space -d "Rename a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a allow-space-ssh -d "Allow SSH access for the space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a disallow-space-ssh -d "Disallow SSH access for the space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a space-ssh-allowed -d "Reports whether SSH is allowed in a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a domains -d "List domains in the target org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-domain -d "Create a domain in an org for later use"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-domain -d "Delete a domain"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-shared-domain -d "Create a domain that can be used by all orgs (admin-only)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-shared-domain -d "Delete a shared domain"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a router-groups -d "List router groups"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a routes -d "List all routes in the current space or the current organization"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-route -d "Create a url route in a space for later use"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a check-route -d "Perform a simple check to determine whether a route currently exists or not"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a map-route -d "Add a url route to an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unmap-route -d "Remove a url route from an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-route -d "Delete a route"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-orphaned-routes -d "Delete all orphaned routes (i.e. those that are not mapped to an app)"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a network-policies -d "List direct network traffic policies"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a add-network-policy -d "Create policy to allow direct network traffic from one app to another"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a remove-network-policy -d "Remove network traffic policy of an app"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a buildpacks -d "List all buildpacks"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-buildpack -d "Create a buildpack"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-buildpack -d "Update a buildpack"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename-buildpack -d "Rename a buildpack"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-buildpack -d "Delete a buildpack"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-user -d "Create a new user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-user -d "Delete a user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a org-users -d "Show org users by role"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-org-role -d "Assign an org role to a user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unset-org-role -d "Remove an org role from a user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a space-users -d "Show space users by role"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-space-role -d "Assign a space role to a user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unset-space-role -d "Remove a space role from a user"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a quotas -d "List available usage quotas"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a quota -d "Show quota info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-quota -d "Assign a quota to an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-quota -d "Define a new resource quota"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-quota -d "Delete a quota"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-quota -d "Update an existing resource quota"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a share-private-domain -d "Share a private domain with an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unshare-private-domain -d "Unshare a private domain with an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a space-quotas -d "List available space resource quotas"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a space-quota -d "Show space quota info"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-space-quota -d "Define a new space resource quota"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-space-quota -d "Update an existing space quota"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-space-quota -d "Delete a space quota definition and unassign the space quota from all spaces"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-space-quota -d "Assign a space quota definition to a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unset-space-quota -d "Unassign a quota from a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service-auth-tokens -d "List service auth tokens"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-service-auth-token -d "Create a service auth token"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-service-auth-token -d "Update a service auth token"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-service-auth-token -d "Delete a service auth token"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service-brokers -d "List service brokers"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-service-broker -d "Create a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-service-broker -d "Update a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-service-broker -d "Delete a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a rename-service-broker -d "Rename a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a migrate-service-instances -d "Migrate service instances from one service plan to another"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a purge-service-offering -d "Recursively remove a service and child objects from Cloud Foundry database without making requests to a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a purge-service-instance -d "Recursively remove a service instance and child objects from Cloud Foundry database without making requests to a service broker"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a service-access -d "List service access settings"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a enable-service-access -d "Enable access to a service or service plan for one or all orgs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a disable-service-access -d "Disable access to a service or service plan for one or all orgs"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a security-group -d "Show a single security group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a security-groups -d "List all security groups"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-security-group -d "Create a security group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a update-security-group -d "Update a security group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-security-group -d "Deletes a security group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a bind-security-group -d "Bind a security group to a particular space, or all existing spaces of an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unbind-security-group -d "Unbind a security group from a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a bind-staging-security-group -d "Bind a security group to the list of security groups to be used for staging applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a staging-security-groups -d "List security groups in the staging set for applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unbind-staging-security-group -d "Unbind a security group from the set of security groups for staging applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a bind-running-security-group -d "Bind a security group to the list of security groups to be used for running applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a running-security-groups -d "List security groups in the set of security groups for running applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a unbind-running-security-group -d "Unbind a security group from the set of security groups for running applications"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a running-environment-variable-group -d "Retrieve the contents of the running environment variable group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a staging-environment-variable-group -d "Retrieve the contents of the staging environment variable group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-staging-environment-variable-group -d "Pass parameters as JSON to create a staging environment variable group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-running-environment-variable-group -d "Pass parameters as JSON to create a running environment variable group"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a isolation-segments -d "List all isolation segments"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a create-isolation-segment -d "Create an isolation segment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a delete-isolation-segment -d "Delete an isolation segment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a enable-org-isolation -d "Entitle an organization to an isolation segment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a disable-org-isolation -d "Revoke an organization's entitlement to an isolation segment"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-org-default-isolation-segment -d "Set the default isolation segment used for apps in spaces in an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a reset-org-default-isolation-segment -d "Reset the default isolation segment used for apps in spaces of an org"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a set-space-isolation-segment -d "Assign the isolation segment for a space"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a reset-space-isolation-segment -d "Reset the space's isolation segment to the org default"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a feature-flags -d "Retrieve list of feature flags with status"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a feature-flag -d "Retrieve an individual feature flag with status"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a enable-feature-flag -d "Allow use of a feature"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a disable-feature-flag -d "Prevent use of a feature"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a curl -d "Executes a request to the targeted API endpoint"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a config -d "Write default values to the config"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a oauth-token -d "Retrieve and display the OAuth token for the current session"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a ssh-code -d "Get a one time password for ssh clients"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a add-plugin-repo -d "Add a new plugin repository"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a remove-plugin-repo -d "Remove a plugin repository"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a list-plugin-repos -d "List all the added plugin repositories"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a repo-plugins -d "List all available plugins in specified repository or in all added repositories"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a plugins -d "List commands of installed plugins"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a install-plugin -d "Install CLI plugin"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c cf -a uninstall-plugin -d "Uninstall CLI plugin"
|
||||
complete -f -n __fish_use_subcommand -c cf -a help -d "Show help"
|
||||
complete -f -n __fish_use_subcommand -c cf -a version -d "Print the version"
|
||||
complete -f -n __fish_use_subcommand -c cf -a login -d "Log user in"
|
||||
complete -f -n __fish_use_subcommand -c cf -a logout -d "Log user out"
|
||||
complete -f -n __fish_use_subcommand -c cf -a passwd -d "Change user password"
|
||||
complete -f -n __fish_use_subcommand -c cf -a target -d "Set or view the targeted org or space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a api -d "Set or view target api url"
|
||||
complete -f -n __fish_use_subcommand -c cf -a auth -d "Authenticate user non-interactively"
|
||||
complete -f -n __fish_use_subcommand -c cf -a apps -d "List all apps in the target space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a app -d "Display health and status for an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a push -d "Push a new app or sync changes to an existing app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a scale -d "Change or view the instance count, disk space limit, and memory limit for an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete -d "Delete an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename -d "Rename an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a start -d "Start an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a stop -d "Stop an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a restart -d "Stop all instances of the app, then start them again. This causes downtime."
|
||||
complete -f -n __fish_use_subcommand -c cf -a restage -d "Recreate the app's executable artifact using the latest pushed app files and the latest environment (variables, service bindings, buildpack, stack, etc.)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a restart-app-instance -d "Terminate, then restart an app instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a run-task -d "Run a one-off task on an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a tasks -d "List tasks of an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a terminate-task -d "Terminate a running task of an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a events -d "Show recent app events"
|
||||
complete -f -n __fish_use_subcommand -c cf -a files -d "Print out a list of files in a directory or the contents of a specific file of an app running on the DEA backend"
|
||||
complete -f -n __fish_use_subcommand -c cf -a logs -d "Tail or show recent logs for an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a env -d "Show all env variables for an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-env -d "Set an env variable for an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unset-env -d "Remove an env variable"
|
||||
complete -f -n __fish_use_subcommand -c cf -a stacks -d "List all stacks (a stack is a pre-built file system, including an operating system, that can run apps)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a stack -d "Show information for a stack (a stack is a pre-built file system, including an operating system, that can run apps)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a copy-source -d "Copies the source code of an application to another existing application (and restarts that application)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-app-manifest -d "Create an app manifest for an app that has been pushed successfully"
|
||||
complete -f -n __fish_use_subcommand -c cf -a get-health-check -d "Show the type of health check performed on an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-health-check -d "Change type of health check performed on an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a enable-ssh -d "Enable ssh for the application"
|
||||
complete -f -n __fish_use_subcommand -c cf -a disable-ssh -d "Disable ssh for the application"
|
||||
complete -f -n __fish_use_subcommand -c cf -a ssh-enabled -d "Reports whether SSH is enabled on an application container instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a ssh -d "SSH to an application container instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a marketplace -d "List available offerings in the marketplace"
|
||||
complete -f -n __fish_use_subcommand -c cf -a services -d "List all service instances in the target space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service -d "Show service instance info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-service -d "Create a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-service -d "Update a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-service -d "Delete a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename-service -d "Rename a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-service-key -d "Create key for a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service-keys -d "List keys for a service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service-key -d "Show service key info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-service-key -d "Delete a service key"
|
||||
complete -f -n __fish_use_subcommand -c cf -a bind-service -d "Bind a service instance to an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unbind-service -d "Unbind a service instance from an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a bind-route-service -d "Bind a service instance to an HTTP route"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unbind-route-service -d "Unbind a service instance from an HTTP route"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-user-provided-service -d "Make a user-provided service instance available to CF apps"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-user-provided-service -d "Update user-provided service instance"
|
||||
complete -f -n __fish_use_subcommand -c cf -a orgs -d "List all orgs"
|
||||
complete -f -n __fish_use_subcommand -c cf -a org -d "Show org info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-org -d "Create an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-org -d "Delete an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename-org -d "Rename an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a spaces -d "List all spaces in an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a space -d "Show space info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-space -d "Create a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-space -d "Delete a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename-space -d "Rename a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a allow-space-ssh -d "Allow SSH access for the space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a disallow-space-ssh -d "Disallow SSH access for the space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a space-ssh-allowed -d "Reports whether SSH is allowed in a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a domains -d "List domains in the target org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-domain -d "Create a domain in an org for later use"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-domain -d "Delete a domain"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-shared-domain -d "Create a domain that can be used by all orgs (admin-only)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-shared-domain -d "Delete a shared domain"
|
||||
complete -f -n __fish_use_subcommand -c cf -a router-groups -d "List router groups"
|
||||
complete -f -n __fish_use_subcommand -c cf -a routes -d "List all routes in the current space or the current organization"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-route -d "Create a url route in a space for later use"
|
||||
complete -f -n __fish_use_subcommand -c cf -a check-route -d "Perform a simple check to determine whether a route currently exists or not"
|
||||
complete -f -n __fish_use_subcommand -c cf -a map-route -d "Add a url route to an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unmap-route -d "Remove a url route from an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-route -d "Delete a route"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-orphaned-routes -d "Delete all orphaned routes (i.e. those that are not mapped to an app)"
|
||||
complete -f -n __fish_use_subcommand -c cf -a network-policies -d "List direct network traffic policies"
|
||||
complete -f -n __fish_use_subcommand -c cf -a add-network-policy -d "Create policy to allow direct network traffic from one app to another"
|
||||
complete -f -n __fish_use_subcommand -c cf -a remove-network-policy -d "Remove network traffic policy of an app"
|
||||
complete -f -n __fish_use_subcommand -c cf -a buildpacks -d "List all buildpacks"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-buildpack -d "Create a buildpack"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-buildpack -d "Update a buildpack"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename-buildpack -d "Rename a buildpack"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-buildpack -d "Delete a buildpack"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-user -d "Create a new user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-user -d "Delete a user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a org-users -d "Show org users by role"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-org-role -d "Assign an org role to a user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unset-org-role -d "Remove an org role from a user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a space-users -d "Show space users by role"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-space-role -d "Assign a space role to a user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unset-space-role -d "Remove a space role from a user"
|
||||
complete -f -n __fish_use_subcommand -c cf -a quotas -d "List available usage quotas"
|
||||
complete -f -n __fish_use_subcommand -c cf -a quota -d "Show quota info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-quota -d "Assign a quota to an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-quota -d "Define a new resource quota"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-quota -d "Delete a quota"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-quota -d "Update an existing resource quota"
|
||||
complete -f -n __fish_use_subcommand -c cf -a share-private-domain -d "Share a private domain with an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unshare-private-domain -d "Unshare a private domain with an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a space-quotas -d "List available space resource quotas"
|
||||
complete -f -n __fish_use_subcommand -c cf -a space-quota -d "Show space quota info"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-space-quota -d "Define a new space resource quota"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-space-quota -d "Update an existing space quota"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-space-quota -d "Delete a space quota definition and unassign the space quota from all spaces"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-space-quota -d "Assign a space quota definition to a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unset-space-quota -d "Unassign a quota from a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service-auth-tokens -d "List service auth tokens"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-service-auth-token -d "Create a service auth token"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-service-auth-token -d "Update a service auth token"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-service-auth-token -d "Delete a service auth token"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service-brokers -d "List service brokers"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-service-broker -d "Create a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-service-broker -d "Update a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-service-broker -d "Delete a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a rename-service-broker -d "Rename a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a migrate-service-instances -d "Migrate service instances from one service plan to another"
|
||||
complete -f -n __fish_use_subcommand -c cf -a purge-service-offering -d "Recursively remove a service and child objects from Cloud Foundry database without making requests to a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a purge-service-instance -d "Recursively remove a service instance and child objects from Cloud Foundry database without making requests to a service broker"
|
||||
complete -f -n __fish_use_subcommand -c cf -a service-access -d "List service access settings"
|
||||
complete -f -n __fish_use_subcommand -c cf -a enable-service-access -d "Enable access to a service or service plan for one or all orgs"
|
||||
complete -f -n __fish_use_subcommand -c cf -a disable-service-access -d "Disable access to a service or service plan for one or all orgs"
|
||||
complete -f -n __fish_use_subcommand -c cf -a security-group -d "Show a single security group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a security-groups -d "List all security groups"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-security-group -d "Create a security group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a update-security-group -d "Update a security group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-security-group -d "Deletes a security group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a bind-security-group -d "Bind a security group to a particular space, or all existing spaces of an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unbind-security-group -d "Unbind a security group from a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a bind-staging-security-group -d "Bind a security group to the list of security groups to be used for staging applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a staging-security-groups -d "List security groups in the staging set for applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unbind-staging-security-group -d "Unbind a security group from the set of security groups for staging applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a bind-running-security-group -d "Bind a security group to the list of security groups to be used for running applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a running-security-groups -d "List security groups in the set of security groups for running applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a unbind-running-security-group -d "Unbind a security group from the set of security groups for running applications"
|
||||
complete -f -n __fish_use_subcommand -c cf -a running-environment-variable-group -d "Retrieve the contents of the running environment variable group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a staging-environment-variable-group -d "Retrieve the contents of the staging environment variable group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-staging-environment-variable-group -d "Pass parameters as JSON to create a staging environment variable group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-running-environment-variable-group -d "Pass parameters as JSON to create a running environment variable group"
|
||||
complete -f -n __fish_use_subcommand -c cf -a isolation-segments -d "List all isolation segments"
|
||||
complete -f -n __fish_use_subcommand -c cf -a create-isolation-segment -d "Create an isolation segment"
|
||||
complete -f -n __fish_use_subcommand -c cf -a delete-isolation-segment -d "Delete an isolation segment"
|
||||
complete -f -n __fish_use_subcommand -c cf -a enable-org-isolation -d "Entitle an organization to an isolation segment"
|
||||
complete -f -n __fish_use_subcommand -c cf -a disable-org-isolation -d "Revoke an organization's entitlement to an isolation segment"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-org-default-isolation-segment -d "Set the default isolation segment used for apps in spaces in an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a reset-org-default-isolation-segment -d "Reset the default isolation segment used for apps in spaces of an org"
|
||||
complete -f -n __fish_use_subcommand -c cf -a set-space-isolation-segment -d "Assign the isolation segment for a space"
|
||||
complete -f -n __fish_use_subcommand -c cf -a reset-space-isolation-segment -d "Reset the space's isolation segment to the org default"
|
||||
complete -f -n __fish_use_subcommand -c cf -a feature-flags -d "Retrieve list of feature flags with status"
|
||||
complete -f -n __fish_use_subcommand -c cf -a feature-flag -d "Retrieve an individual feature flag with status"
|
||||
complete -f -n __fish_use_subcommand -c cf -a enable-feature-flag -d "Allow use of a feature"
|
||||
complete -f -n __fish_use_subcommand -c cf -a disable-feature-flag -d "Prevent use of a feature"
|
||||
complete -f -n __fish_use_subcommand -c cf -a curl -d "Executes a request to the targeted API endpoint"
|
||||
complete -f -n __fish_use_subcommand -c cf -a config -d "Write default values to the config"
|
||||
complete -f -n __fish_use_subcommand -c cf -a oauth-token -d "Retrieve and display the OAuth token for the current session"
|
||||
complete -f -n __fish_use_subcommand -c cf -a ssh-code -d "Get a one time password for ssh clients"
|
||||
complete -f -n __fish_use_subcommand -c cf -a add-plugin-repo -d "Add a new plugin repository"
|
||||
complete -f -n __fish_use_subcommand -c cf -a remove-plugin-repo -d "Remove a plugin repository"
|
||||
complete -f -n __fish_use_subcommand -c cf -a list-plugin-repos -d "List all the added plugin repositories"
|
||||
complete -f -n __fish_use_subcommand -c cf -a repo-plugins -d "List all available plugins in specified repository or in all added repositories"
|
||||
complete -f -n __fish_use_subcommand -c cf -a plugins -d "List commands of installed plugins"
|
||||
complete -f -n __fish_use_subcommand -c cf -a install-plugin -d "Install CLI plugin"
|
||||
complete -f -n __fish_use_subcommand -c cf -a uninstall-plugin -d "Uninstall CLI plugin"
|
||||
|
||||
@@ -14,16 +14,68 @@
|
||||
# Let's erase them, so that we start from a blank state
|
||||
complete -c conda -e
|
||||
|
||||
# Complete using -n to select the given conda subcommand
|
||||
# and passing the rest of the arguments to `complete`
|
||||
# The goal here is to reduce clutter in the definitions below
|
||||
function __fish_conda_subcommand
|
||||
# This function does triple-duty:
|
||||
# If called without arguments, it will print the first subcommand.
|
||||
# If one exists, it returns false.
|
||||
# If it doesn't, it returns true.
|
||||
#
|
||||
# If called with arguments, it will check that those match the given subcommands,
|
||||
# and that there are no additional subcommands.
|
||||
set -l subcmds $argv
|
||||
set -q subcmds[1]
|
||||
set -l have_sub $status
|
||||
|
||||
# get the commandline args without the "conda"
|
||||
set -l toks (commandline -opc)[2..-1]
|
||||
|
||||
# Remove any important options - if we had options with arguments,
|
||||
# they'd need to be listed here to be removed.
|
||||
argparse -i h/help v/version -- $toks 2>/dev/null
|
||||
# Return false if it fails - this shouldn't really happen,
|
||||
# so all bets are off
|
||||
or return 2
|
||||
|
||||
# Remove all matching subcommands
|
||||
while set -q subcmds[1]
|
||||
# If the subcommand matches, or we have an option, go on.
|
||||
# (if the option took an argument we wouldn't know,
|
||||
# so it needs to be argparse'd out above!)
|
||||
if test "$subcmds[1]" = "$argv[1]"
|
||||
set -e argv[1]
|
||||
set -e subcmds[1]
|
||||
else if string match -q -- '-*' $argv[1]
|
||||
set -e argv[1]
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
# Skip any remaining options.
|
||||
while string match -q -- '-*' $argv[1]
|
||||
set -e argv[1]
|
||||
end
|
||||
|
||||
# If we have no subcommand left,
|
||||
# we either matched all given subcommands or we need one.
|
||||
if not set -q argv[1]
|
||||
return $have_sub
|
||||
end
|
||||
|
||||
echo -- $argv[1]
|
||||
|
||||
# If we didn't have subcommands to check, return true
|
||||
# If we did, this is an additional command and so we return false.
|
||||
not test $have_sub -eq 0
|
||||
end
|
||||
|
||||
function __fish_conda -a cmd
|
||||
complete -c conda -n "__fish_seen_subcommand_from $cmd" $argv[2..-1]
|
||||
complete -c conda -n "contains -- (__fish_conda_subcommand) $cmd" $argv[2..-1]
|
||||
end
|
||||
|
||||
# Complete for the first argument only
|
||||
function __fish_conda_top
|
||||
complete -c conda -n __fish_is_first_token $argv
|
||||
complete -c conda -n 'not __fish_conda_subcommand' $argv
|
||||
end
|
||||
|
||||
function __fish_conda_config_keys
|
||||
@@ -294,3 +346,8 @@ __fish_conda search -l platform -x -a "$__fish_conda_platforms" -d "Search the g
|
||||
|
||||
# Option reverse-dependency
|
||||
__fish_conda search -l reverse-dependency -d "Perform a reverse dependency search"
|
||||
|
||||
__fish_conda_top -a env -d "Conda options for environments"
|
||||
complete -c conda -n "__fish_conda_subcommand env" -a create -d "Create a new environment"
|
||||
complete -c conda -n "__fish_conda_subcommand env" -a list -d "List all conda environments"
|
||||
complete -c conda -n "__fish_conda_subcommand env create" -s f -l file -r -d "Create environment from yaml file"
|
||||
|
||||
112
share/completions/fail2ban-client.fish
Normal file
112
share/completions/fail2ban-client.fish
Normal file
@@ -0,0 +1,112 @@
|
||||
function __fail2ban_jails
|
||||
# No need to deduplicate because fish will take care of that for us
|
||||
path basename {,/usr/local}/etc/fail2ban/filter.d/*.{conf,local} | path change-extension ""
|
||||
end
|
||||
|
||||
function __fail2ban_actions
|
||||
# No need to deduplicate because fish will take care of that for us
|
||||
path basename {,/usr/local}/etc/fail2ban/action.d/*.{conf,local} | path change-extension ""
|
||||
end
|
||||
|
||||
# basic options
|
||||
complete -c fail2ban-client -s c -l conf -d "Configuration dir"
|
||||
complete -c fail2ban-client -s s -l socket -d "Socket path"
|
||||
complete -c fail2ban-client -s p -l pidfile -d "Pidfile path"
|
||||
complete -c fail2ban-client -l pname -d "Name of the process"
|
||||
complete -c fail2ban-client -l loglevel -d "loglevel of client" -xa "CRITICAL ERROR WARNING NOTICE INFO DEBUG TRACEDEBUG HEAVYDEBUG"
|
||||
complete -c fail2ban-client -l logtarget -d "Logging target" -a "stdout stderr syslog sysout" # or path
|
||||
complete -c fail2ban-client -l logtarget -d "Syslogsocket" -a "auto" # or path
|
||||
complete -c fail2ban-client -s d -d "Dump configuration"
|
||||
complete -c fail2ban-client -l dp -l dump-pretty -d "Dump configuration (pretty)"
|
||||
complete -c fail2ban-client -s t -l test -d "Test configuration"
|
||||
complete -c fail2ban-client -s i -d "Run in interactive mode"
|
||||
complete -c fail2ban-client -s v -d "Increase verbosity"
|
||||
complete -c fail2ban-client -s q -d "Decrease verbosity"
|
||||
complete -c fail2ban-client -s x -d "Force execution of server"
|
||||
complete -c fail2ban-client -s b -d "Start server in background (default)"
|
||||
complete -c fail2ban-client -s f -d "Start server in foreground"
|
||||
complete -c fail2ban-client -l str2sec -d "Convert time abbr format to secs"
|
||||
complete -c fail2ban-client -s h -l help -d "Display help message"
|
||||
complete -c fail2ban-client -s V -l version -d "Display client version"
|
||||
|
||||
# subcommands
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "start" -d "Start fail2ban server or jail"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "restart" -d "Restart server or jail"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "reload" -d "Reload server configuration"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "stop" -d "Stop fail2ban server or jail"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "unban" -d "Unban ip address(es)"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "banned" -d "List jails w/ their banned IPs"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "status" -d "Get server or jail status"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "ping" -d "Check if server is alive"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "help" -d "Prints usage synopsis"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "version" -d "Prints server version"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "set"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "get"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "flushlogs" -d "Flushes log files and reopens"
|
||||
complete -c fail2ban-client -n __fish_is_first_token -xa "add"
|
||||
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from start" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from stop" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from status" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from restart" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from reload" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from add" -xa "(__fail2ban_jails)"
|
||||
|
||||
# restart options
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from restart" -l unban
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from reload" -l if-exists
|
||||
|
||||
# reload options
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from restart" -l restart
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from reload" -l unban
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from reload" -l all
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from reload" -l if-exists
|
||||
|
||||
# unban options
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from unban" -l all
|
||||
|
||||
# get/set loglevel
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa loglevel -d "Get server log level"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa loglevel -d "Change server log level"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in loglevel" -xa "CRITICAL ERROR WARNING NOTICE INFO DEBUG TRACEDEBUG HEAVYDEBUG"
|
||||
|
||||
# get/set logtarget
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa logtarget -d "Get server log output"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa logtarget -d "Change server log output"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in logtarget" -a "STDOUT STDERR SYSLOG SYSTEMD-JOURNAL" # or path
|
||||
|
||||
# get/set syslogsocket
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa syslogsocket -d "Get server syslog socket"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa syslogsocket -d "Change server syslog socket"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in syslogsocket" -a "auto" # or path
|
||||
|
||||
# get/set dbfile
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa dbfile -d "Get server db path"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa dbfile -d "Change server db path"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in dbfile" -a "None" # or path
|
||||
|
||||
# get/set dbmaxmatches
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa dbmaxmatches -d "Get max matches stored per ticket"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa dbmaxmatches -d "Set max matches stored per ticket"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in dbmaxmatches" -xa "(seq 0 100)"
|
||||
|
||||
# get/set dbpurgeage
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_prev_arg_in get" -xa dbpurgeage -d "Get secs ban history will be kept"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in set" -xa dbpurgeage -d "Set secs ban history will be kept"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in dbpurgeage" -xa "(seq 0 30 3600)"
|
||||
|
||||
# get/set <jail> options
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set get" -n "__fish_prev_arg_in set get" -xa "(__fail2ban_jails)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_is_nth_token 3" -xa "idle ignoreself addignoreip delignoreip ignorecommand ignorecache addlogpath dellogpath logencoding addjournalmatch deljournalmatch addfailregex delfailregex bantime datepattern usedns attempt banip unbanip maxretry maxmatches maxlines addaction delaction action"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get" -n "__fish_is_nth_token 3" -xa "banned logpath logencoding journalmatch ignoreself ignoreip ignorecommand failregex ignoreregex findtime bantime datepattern usedns banip maxretry maxmatches maxlines actions action actionproperties actionmethods action"
|
||||
|
||||
# complete actions for `get/set jail action/actionproperties/actionmethods` and `set jail addaction/delaction`
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get set" -n "__fish_prev_arg_in action{,properties,methods}" -n "__fish_is_nth_token 4" -xa "(__fail2ban_actions)"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from set" -n "__fish_prev_arg_in {add,del}action" -n "__fish_is_nth_token 4" -xa "(__fail2ban_actions)"
|
||||
|
||||
# complete action commands for `get/set jail action <action>`
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get set" -n "__fish_seen_subcommand_from action" -n "__fish_is_nth_token 5" -xa "actionstart actionstop actioncheck actionban actionunban timeout"
|
||||
|
||||
# specific enumerable jail properties
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get set" -n "__fish_prev_arg_in idle" -xa "on off"
|
||||
complete -c fail2ban-client -n "__fish_seen_subcommand_from get set" -n "__fish_prev_arg_in ignoreself" -xa "true false"
|
||||
@@ -816,8 +816,8 @@ nohelpers\t'exclude helper commands'
|
||||
config\t'list completion.commands'"
|
||||
|
||||
# Options shared between multiple commands
|
||||
set -l format_pretty_args "oneline\t'hash⏎ titleline' short\t'hash⏎ author⏎ titleline' medium\t'hash⏎ author⏎ authordate⏎ title⏎ message' full\t'hash⏎ author⏎ committer⏎ title⏎ message'
|
||||
fuller\t'hash⏎ author⏎ authordate⏎ committer⏎ committerdate⏎ title⏎ message' email\t'hash⏎ date⏎ author⏎ authordate⏎ title⏎ message' raw\t'Show raw commit as stored in commit object' format:\t'Specify format string'"
|
||||
set -l format_pretty_args "oneline\t'hash titleline' short\t'hash author titleline' medium\t'hash author authordate title message' full\t'hash author committer title message'
|
||||
fuller\t'hash author authordate committer committerdate title message' email\t'hash date author authordate title message' raw\t'Show raw commit as stored in commit object' format:\t'Specify format string'"
|
||||
complete -f -c git -n '__fish_git_using_command log show diff-tree rev-list' -l pretty -a $format_pretty_args
|
||||
|
||||
complete -c git -n '__fish_git_using_command diff show range-diff' -l abbrev -d 'Show only a partial prefix instead of the full 40-byte hexadecimal object name'
|
||||
@@ -1127,7 +1127,7 @@ complete -f -c git -n '__fish_git_using_command archive' -l worktree-attributes
|
||||
# TODO options
|
||||
|
||||
### bisect
|
||||
complete -f -c git -n __fish_git_needs_command -a bisect -d 'Find the change that introduced a bug by binary search'
|
||||
complete -f -c git -n __fish_git_needs_command -a bisect -d 'Use binary search to find what introduced a bug'
|
||||
complete -f -c git -n '__fish_git_using_command bisect' -n '__fish_prev_arg_in bisect' -xa "start\t'Start a new bisect session'
|
||||
bad\t'Mark a commit as bad'
|
||||
new\t'Mark a commit as new'
|
||||
@@ -1174,6 +1174,22 @@ complete -f -c git -n '__fish_git_using_command branch' -l merged -d 'List branc
|
||||
complete -f -c git -n '__fish_git_using_command branch' -l no-merged -d 'List branches that have not been merged'
|
||||
complete -f -c git -n '__fish_git_using_command branch' -l unset-upstream -d 'Remove branch upstream information'
|
||||
|
||||
### bundle
|
||||
set -l bundlecommands create verify list-heads unbundle
|
||||
complete -f -c git -n __fish_git_needs_command -a bundle -d 'Create, unpack, and manipulate "bundle" files'
|
||||
complete -f -c git -n "__fish_git_using_command bundle" -n "not __fish_seen_subcommand_from $bundlecommands" -a "create\t'Create a bundle'
|
||||
verify\t'Check that the bundle is valid and will apply cleanly'
|
||||
list-heads\t'List the references defined in the bundle'
|
||||
unbundle\t'Build a pack index file and print all defined references'"
|
||||
complete -f -c git -n "__fish_git_using_command bundle" -n "__fish_seen_subcommand_from create verify" -s q -l quiet -d 'Do not show progress meter'
|
||||
complete -f -c git -n "__fish_git_using_command bundle" -n "__fish_seen_subcommand_from create unbundle" -l progress -d 'Show progress meter'
|
||||
complete -f -c git -n "__fish_git_using_command bundle" -n "__fish_seen_subcommand_from create" -l all-progress -d 'Show progress meter during object writing phase'
|
||||
complete -f -c git -n "__fish_git_using_command bundle" -n "__fish_seen_subcommand_from create" -l all-progress-implied -d 'Similar to --all-progress when progress meter is shown'
|
||||
complete -x -c git -n "__fish_git_using_command bundle" -n "__fish_seen_subcommand_from create" -l version -d 'Specify bundle format version'
|
||||
# FIXME: <file> should be suggested first and <git-rev-list args> second (also, '--all' is only valid in rev-list)
|
||||
complete -c git -n '__fish_git_using_command bundle' -n "__fish_seen_subcommand_from create" -ka '--all\t"All refs"'
|
||||
complete -c git -n '__fish_git_using_command bundle' -n "__fish_seen_subcommand_from create" -ka '(__fish_git_ranges)'
|
||||
|
||||
### cherry
|
||||
complete -f -c git -n __fish_git_needs_command -a cherry -d 'Find commits yet to be applied to upstream'
|
||||
complete -f -c git -n '__fish_git_using_command cherry' -s v -d 'Show the commit subjects next to the SHA1s'
|
||||
@@ -1289,7 +1305,7 @@ complete -f -c git -n '__fish_git_using_command describe' -l always -d 'Show uni
|
||||
complete -f -c git -n '__fish_git_using_command describe' -l first-parent -d 'Follow only the first parent of a merge commit'
|
||||
|
||||
### diff
|
||||
complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between commits or commit and working tree'
|
||||
complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between commits and working tree'
|
||||
complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_ranges)'
|
||||
complete -c git -n '__fish_git_using_command diff' -l cached -d 'Show diff of changes in the index'
|
||||
complete -c git -n '__fish_git_using_command diff' -l staged -d 'Show diff of changes in the index'
|
||||
@@ -1993,12 +2009,13 @@ complete -f -c git -n '__fish_git_using_command format-patch' -l no-numbered -s
|
||||
|
||||
## git submodule
|
||||
set -l submodulecommands add status init deinit update set-branch set-url summary foreach sync absorbgitdirs
|
||||
complete -f -c git -n __fish_git_needs_command -a "submodule\t'Initialize, update or inspect submodules'
|
||||
complete -f -c git -n __fish_git_needs_command -a "submodule\t'Initialize, update or inspect submodules'"
|
||||
complete -f -c git -n "__fish_git_using_command submodule" -n "not __fish_seen_subcommand_from $submodulecommands" -a "
|
||||
status\t'Show submodule status'
|
||||
init\t'Initialize all submodules'
|
||||
deinit\t'Unregister the given submodules'
|
||||
update\t'Update all submodules'
|
||||
set-branch\t'Sets the default remote tracking branch for the submodule'
|
||||
set-branch\t'Set the default remote tracking branch'
|
||||
set-url\t'Sets the URL of the specified submodule'
|
||||
summary\t'Show commit summary'
|
||||
foreach\t'Run command on each submodule'
|
||||
@@ -2226,15 +2243,13 @@ end
|
||||
|
||||
# source git-* commands' autocompletion file if exists
|
||||
set -f __fish_git_custom_commands_completion
|
||||
for file in $PATHgitdash
|
||||
test ! -x $file
|
||||
and continue
|
||||
|
||||
set -l subcommand (path basename $file)
|
||||
for file in (path filter -xZ -- $PATHgitdash | path basename)
|
||||
# Already seen this command earlier in $PATH.
|
||||
contains -- $subcommand $__fish_git_custom_commands_completion
|
||||
contains -- $file $__fish_git_custom_commands_completion
|
||||
and continue
|
||||
|
||||
complete -c git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)"
|
||||
# Running `git foo` ends up running `git-foo`, so we need to ignore the `git-` here.
|
||||
set -l cmd (string replace -r '^git-' '' -- $file)
|
||||
complete -c git -f -n "__fish_git_using_command $cmd" -a "(__fish_git_complete_custom_command $cmd)"
|
||||
set -a __fish_git_custom_commands_completion $subcommand
|
||||
end
|
||||
|
||||
@@ -149,6 +149,19 @@ function __fish_complete_iw
|
||||
channel "" \
|
||||
freq "" \
|
||||
power_save "Power save state"
|
||||
else
|
||||
switch "$cmd[5]"
|
||||
case type
|
||||
if not set -q cmd[6]
|
||||
printf '%s\n' managed ibss monitor mesh wds
|
||||
end
|
||||
case channel
|
||||
if not set -q cmd[6]
|
||||
# cmd[6] is just the simple channel number
|
||||
else if not set -q cmd[7]
|
||||
printf '%s\n' NOHT HT20 HT40+ HT40- 5MHz 10MHz 80MHz 160MHz
|
||||
end
|
||||
end
|
||||
end
|
||||
case get
|
||||
if not set -q cmd[5]
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
set -l subcommands complete config details download help magnet open search
|
||||
|
||||
# Subcommands
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a complete -d "Print bash completion command"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a config -d "Show or update configuration"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a details -d "Show details about torrent with given ID"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a download -d "Download torrent with given ID"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a help -d "Print detailed help for another command"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a magnet -d "Copy magnet link with given ID to clipboard"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a open -d "Open torrent in the default torrent application"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -a search -d "Search for torrents"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a complete -d "Print bash completion command"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a config -d "Show or update configuration"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a details -d "Show details about torrent with given ID"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a download -d "Download torrent with given ID"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a help -d "Print detailed help for another command"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a magnet -d "Copy magnet link with given ID to clipboard"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a open -d "Open torrent in the default torrent application"
|
||||
complete -f -n __fish_use_subcommand -c mariner -a search -d "Search for torrents"
|
||||
|
||||
# Global options
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -l version -d "Show program's version number and exit"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -s v -l verbose -d "Increase verbosity of output. Can be repeated"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -s q -l quiet -d "Suppress output except warnings and errors"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -s h -l help -d "Show help message and exit"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c mariner -l debug -d "Show tracebacks on errors"
|
||||
complete -r -n "__fish_use_subcommand $subcommands" -c mariner -l log-file -d "Specify a file to log output. Default ~/.local/share/mariner/mariner.log"
|
||||
complete -r -n "__fish_use_subcommand $subcommands" -c mariner -l config-file -d "Path to config file. Default ~/.config/mariner/config.yaml"
|
||||
complete -f -n __fish_use_subcommand -c mariner -l version -d "Show program's version number and exit"
|
||||
complete -f -n __fish_use_subcommand -c mariner -s v -l verbose -d "Increase verbosity of output. Can be repeated"
|
||||
complete -f -n __fish_use_subcommand -c mariner -s q -l quiet -d "Suppress output except warnings and errors"
|
||||
complete -f -n __fish_use_subcommand -c mariner -s h -l help -d "Show help message and exit"
|
||||
complete -f -n __fish_use_subcommand -c mariner -l debug -d "Show tracebacks on errors"
|
||||
complete -r -n __fish_use_subcommand -c mariner -l log-file -d "Specify a file to log output. Default ~/.local/share/mariner/mariner.log"
|
||||
complete -r -n __fish_use_subcommand -c mariner -l config-file -d "Path to config file. Default ~/.config/mariner/config.yaml"
|
||||
|
||||
# Config options
|
||||
complete -f -n "__fish_seen_subcommand_from config" -c mariner -s s -l show -d "Show the configuration"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if test (uname) = Darwin # OS X
|
||||
complete -c open -s a -d 'specify app name' -r -a "(mdfind -onlyin /Applications -onlyin ~/Applications -onlyin /Developer/Applications 'kMDItemContentType==com.apple.application-*' | string replace -r '.+/(.+).app' '\$1')"
|
||||
complete -c open -s b -d 'specify app bundle id' -x -a "(mdls (mdfind -onlyin /Applications -onlyin ~/Applications -onlyin /Developer/Applications 'kMDItemContentType==com.apple.application-*') -name kMDItemCFBundleIdentifier | string replace -rf 'kMDItemCFBundleIdentifier = \"(.+)\"' '\$1')"
|
||||
complete -c open -s a -d 'specify app name' -r -a "(mdfind -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications -onlyin /Developer/Applications 'kMDItemContentType==com.apple.application-*' | string replace -r '.+/(.+).app' '\$1')"
|
||||
complete -c open -s b -d 'specify app bundle id' -x -a "(mdls (mdfind -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications -onlyin /Developer/Applications 'kMDItemContentType==com.apple.application-*') -name kMDItemCFBundleIdentifier | string replace -rf 'kMDItemCFBundleIdentifier = \"(.+)\"' '\$1')"
|
||||
complete -c open -s e -d 'open in TextEdit'
|
||||
complete -c open -s t -d 'open in default editor'
|
||||
complete -c open -s f -d 'open stdin with editor'
|
||||
|
||||
28
share/completions/otool.fish
Normal file
28
share/completions/otool.fish
Normal file
@@ -0,0 +1,28 @@
|
||||
complete otool -d 'object file displaying tool' -r
|
||||
complete otool -s f -d 'print the fat headers' -F
|
||||
complete otool -s a -d 'print the archive header' -F
|
||||
complete otool -s h -d 'print the mach header' -F
|
||||
complete otool -s l -d 'print the load commands' -F
|
||||
complete otool -s L -d 'print shared libraries used' -F
|
||||
complete otool -s d -d 'print the data section' -F
|
||||
complete otool -s D -d 'print shared library id name' -F
|
||||
complete otool -s o -d 'print the Obj-C segment' -F
|
||||
complete otool -s r -d 'print the relocation entries' -F
|
||||
complete otool -s I -d 'print the indirect symbol table' -F
|
||||
complete otool -s C -d 'print linker optimization hints' -F
|
||||
complete otool -s G -d 'print the data in code table' -F
|
||||
complete otool -s c -d 'print arg of a core file' -F
|
||||
complete otool -s s -d 'print contents of <seg> <sect>' -x
|
||||
complete otool -s P -d 'print Info.plist section' -F
|
||||
complete otool -s x -d 'print all text sections' -F
|
||||
complete otool -s p -d 'specify routine to dissassemble' -x
|
||||
complete otool -s v -d 'print verbosely'
|
||||
complete otool -s V -d 'symbolicate disassembled operands'
|
||||
complete otool -s X -d 'omit leading addresses, headers'
|
||||
complete otool -s m -d "disable archive(member) syntax"
|
||||
complete otool -s B -d 'ARM only: force Thumb disassembly'
|
||||
complete otool -s q -d "(default) use llvm's disassembler"
|
||||
complete otool -s Q -d "use otool's disassembler"
|
||||
complete otool -o mcpu -d 'specify cpu for disassembly'
|
||||
complete otool -s j -d 'print opcode bytes'
|
||||
complete otool -l version -f -d "print the version"
|
||||
@@ -1,77 +1,68 @@
|
||||
#completion for port
|
||||
complete port -n "__fish_seen_subcommand_from $subcommands" -a '(__fish_print_port_packages)' -d Package
|
||||
|
||||
set -l subcommands activate archive build cat cd checksum clean configure \
|
||||
contents deactivate dependents deps destroot dir distcheck dmg echo \
|
||||
edit extract fetch file gohome info install installed lint list \
|
||||
livecheck location load log logfile mirror mdmg mpkg notes outdated \
|
||||
patch pkg provides rdependents rdeps reload rev search select \
|
||||
selfupdate setrequested setunrequested sync test unarchive uninstall \
|
||||
unload unsetrequested upgrade url usage variants version work
|
||||
|
||||
complete -c port -n "__fish_seen_subcommand_from $subcommands" -a '(__fish_print_port_packages)' -d Package
|
||||
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a activate -d 'Set version of a port to active'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a archive -d "Create image for port without installing"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a build -d 'Run build phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a cat -d 'Print the Portfile of the given port(s)'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a cd -d 'Change directory to that containing portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a checksum -d 'Compute checksums of distribution files'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a clean -d 'Remove temporary files used to build a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a configure -d 'Run configure phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a contents -d 'List the files installed by a given port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a deactivate -d 'Set the status of a port to inactive'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a dependents -d 'List ports that depend on a given port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a deps -d 'Display a dependency listing for given port(s)'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a destroot -d 'Run destroot phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a dir -d 'print directory with Portfile for port expression'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a distcheck -d 'Check if port can be fetched from all mirrors'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a dmg -d 'Create binary archives of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a echo -d 'Print the list of ports the argument expands to'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a edit -d 'Open the Portfile in an editor'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a extract -d 'Run extract phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a fetch -d 'Run fetch phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a file -d 'Display the path to the Portfile for portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a help -d 'Get help on MacPorts commands'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a gohome -d 'Load home page for given portname in web browser'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a info -d 'Return information about the given ports'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a install -d 'Install a new port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a installed -d 'List installed versions (of port)'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a lint -d 'Verifies Portfile for portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a list -d 'List latest available version for given ports'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a livecheck -d 'Check if new version of software is available'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a location -d 'Print location of archive used for (de)activation'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a load -d "load a port's daemon"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a log -d 'Parse and show log files for portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a logfile -d 'Display the path to the log file for portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a mirror -d 'Create/update local mirror of distfiles'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a mdmg -d 'Create disk image of portname and dependencies'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a mpkg -d 'Create binary archives of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a notes -d 'Displays notes for portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a outdated -d 'List outdated ports'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a patch -d 'Run patch phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a pkg -d 'Create binary archives of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a provides -d 'Find the port that installed a file'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a rdependents -d 'Recursively list ports depending on given port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a rdeps -d 'Display a recursive dependency listing of port(s)'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a reload -d "reload a port's daemon"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a rev-upgrade -d 'Rebuild ports containing broken binaries'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a search -d 'Search for a port using keywords'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a select -d 'Selects a version to be the default'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a selfupdate -d 'Upgrade MacPorts and update list of ports'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a setrequested -d 'Mark portname as requested'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a setunrequested -d 'Mark portname as unrequested'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a sync -d 'Update the port definition files'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a test -d 'Run test phase of a port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a unarchive -d 'Extract destroot of given ports from archive'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a uninstall -d 'Remove a previously installed port'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a unload -d "Unload a port's daemon"
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a unsetrequested -d 'Mark portname as unrequested'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a upgrade -d 'Upgrade a port to the latest version'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a url -d 'Display URL for path of given portname'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a usage -d 'Displays a condensed usage summary'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a variants -d 'Print list of variants with descriptions'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a version -d 'Print the MacPorts version'
|
||||
complete -f -n "__fish_use_subcommand $subcommands" -c port -a work -d 'Displays path to work directory for portname'
|
||||
complete port -f -n __fish_use_subcommand -a activate -d 'Set version of a port to active'
|
||||
complete port -f -n __fish_use_subcommand -a archive -d "Create image for port without installing"
|
||||
complete port -f -n __fish_use_subcommand -a build -d 'Run build phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a cat -d 'Print the Portfile of the given port(s)'
|
||||
complete port -f -n __fish_use_subcommand -a cd -d 'Change directory to that containing portname'
|
||||
complete port -f -n __fish_use_subcommand -a checksum -d 'Compute checksums of distribution files'
|
||||
complete port -f -n __fish_use_subcommand -a clean -d 'Remove temporary files used to build a port'
|
||||
complete port -f -n __fish_use_subcommand -a configure -d 'Run configure phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a contents -d 'List the files installed by a given port'
|
||||
complete port -f -n __fish_use_subcommand -a deactivate -d 'Set the status of a port to inactive'
|
||||
complete port -f -n __fish_use_subcommand -a dependents -d 'List ports that depend on a given port'
|
||||
complete port -f -n __fish_use_subcommand -a deps -d 'Display a dependency listing for given port(s)'
|
||||
complete port -f -n __fish_use_subcommand -a destroot -d 'Run destroot phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a dir -d 'print directory with Portfile for port expression'
|
||||
complete port -f -n __fish_use_subcommand -a distcheck -d 'Check if port can be fetched from all mirrors'
|
||||
complete port -f -n __fish_use_subcommand -a dmg -d 'Create binary archives of a port'
|
||||
complete port -f -n __fish_use_subcommand -a echo -d 'Print the list of ports the argument expands to'
|
||||
complete port -f -n __fish_use_subcommand -a edit -d 'Open the Portfile in an editor'
|
||||
complete port -f -n __fish_use_subcommand -a extract -d 'Run extract phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a fetch -d 'Run fetch phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a file -d 'Display the path to the Portfile for portname'
|
||||
complete port -f -n __fish_use_subcommand -a help -d 'Get help on MacPorts commands'
|
||||
complete port -f -n __fish_use_subcommand -a gohome -d 'Load home page for given portname in web browser'
|
||||
complete port -f -n __fish_use_subcommand -a info -d 'Return information about the given ports'
|
||||
complete port -f -n __fish_use_subcommand -a install -d 'Install a new port'
|
||||
complete port -f -n __fish_use_subcommand -a installed -d 'List installed versions (of port)'
|
||||
complete port -f -n __fish_use_subcommand -a lint -d 'Verifies Portfile for portname'
|
||||
complete port -f -n __fish_use_subcommand -a list -d 'List latest available version for given ports'
|
||||
complete port -f -n __fish_use_subcommand -a livecheck -d 'Check if new version of software is available'
|
||||
complete port -f -n __fish_use_subcommand -a location -d 'Print location of archive used for (de)activation'
|
||||
complete port -f -n __fish_use_subcommand -a load -d "load a port's daemon"
|
||||
complete port -f -n __fish_use_subcommand -a log -d 'Parse and show log files for portname'
|
||||
complete port -f -n __fish_use_subcommand -a logfile -d 'Display the path to the log file for portname'
|
||||
complete port -f -n __fish_use_subcommand -a mirror -d 'Create/update local mirror of distfiles'
|
||||
complete port -f -n __fish_use_subcommand -a mdmg -d 'Create disk image of portname and dependencies'
|
||||
complete port -f -n __fish_use_subcommand -a mpkg -d 'Create binary archives of a port'
|
||||
complete port -f -n __fish_use_subcommand -a notes -d 'Displays notes for portname'
|
||||
complete port -f -n __fish_use_subcommand -a outdated -d 'List outdated ports'
|
||||
complete port -f -n __fish_use_subcommand -a patch -d 'Run patch phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a pkg -d 'Create binary archives of a port'
|
||||
complete port -f -n __fish_use_subcommand -a provides -d 'Find the port that installed a file'
|
||||
complete port -f -n __fish_use_subcommand -a rdependents -d 'Recursively list ports depending on given port'
|
||||
complete port -f -n __fish_use_subcommand -a rdeps -d 'Display a recursive dependency listing of port(s)'
|
||||
complete port -f -n __fish_use_subcommand -a reload -d "reload a port's daemon"
|
||||
complete port -f -n __fish_use_subcommand -a rev-upgrade -d 'Rebuild ports containing broken binaries'
|
||||
complete port -f -n __fish_use_subcommand -a search -d 'Search for a port using keywords'
|
||||
complete port -f -n __fish_use_subcommand -a select -d 'Selects a version to be the default'
|
||||
complete port -f -n __fish_use_subcommand -a selfupdate -d 'Upgrade MacPorts and update list of ports'
|
||||
complete port -f -n __fish_use_subcommand -a setrequested -d 'Mark portname as requested'
|
||||
complete port -f -n __fish_use_subcommand -a setunrequested -d 'Mark portname as unrequested'
|
||||
complete port -f -n __fish_use_subcommand -a sync -d 'Update the port definition files'
|
||||
complete port -f -n __fish_use_subcommand -a test -d 'Run test phase of a port'
|
||||
complete port -f -n __fish_use_subcommand -a unarchive -d 'Extract destroot of given ports from archive'
|
||||
complete port -f -n __fish_use_subcommand -a uninstall -d 'Remove a previously installed port'
|
||||
complete port -f -n __fish_use_subcommand -a unload -d "Unload a port's daemon"
|
||||
complete port -f -n __fish_use_subcommand -a unsetrequested -d 'Mark portname as unrequested'
|
||||
complete port -f -n __fish_use_subcommand -a upgrade -d 'Upgrade a port to the latest version'
|
||||
complete port -f -n __fish_use_subcommand -a url -d 'Display URL for path of given portname'
|
||||
complete port -f -n __fish_use_subcommand -a usage -d 'Displays a condensed usage summary'
|
||||
complete port -f -n __fish_use_subcommand -a variants -d 'Print list of variants with descriptions'
|
||||
complete port -f -n __fish_use_subcommand -a version -d 'Print the MacPorts version'
|
||||
complete port -f -n __fish_use_subcommand -a work -d 'Displays path to work directory for portname'
|
||||
|
||||
complete -c port -s v -d 'Verbose mode, generates verbose messages'
|
||||
complete -c port -s d -d 'Debug mode, implies -v'
|
||||
|
||||
3
share/completions/proxychains.fish
Normal file
3
share/completions/proxychains.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
complete -c proxychains -n __fish_is_first_token -s q -d "Makes proxychains quiet"
|
||||
complete -c proxychains -n __fish_is_first_token -s f -r -F -d "Specify a config file"
|
||||
complete -c proxychains -xa "(__fish_complete_subcommand)"
|
||||
@@ -1,5 +1,5 @@
|
||||
# Note that when a completion file is sourced a new block scope is created so `set -l` works.
|
||||
set -l __fish_status_all_commands current-command current-filename current-function current-line-number features filename fish-path function is-block is-breakpoint is-command-substitution is-full-job-control is-interactive is-interactive-job-control is-login is-no-job-control job-control line-number print-stack-trace stack-trace test-feature
|
||||
set -l __fish_status_all_commands current-command current-commandline current-filename current-function current-line-number features filename fish-path function is-block is-breakpoint is-command-substitution is-full-job-control is-interactive is-interactive-job-control is-login is-no-job-control job-control line-number print-stack-trace stack-trace test-feature
|
||||
|
||||
# These are the recognized flags.
|
||||
complete -c status -s h -l help -d "Display help and exit"
|
||||
@@ -16,6 +16,7 @@ complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_com
|
||||
|
||||
# The subcommands that are not "is-something" which don't change the fish state.
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-command -d "Print the name of the currently running command or function"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-commandline -d "Print the currently running command with its arguments"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-filename -d "Print the filename of the currently running script"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a filename -d "Print the filename of the currently running script"
|
||||
complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-function -d "Print the name of the current function"
|
||||
|
||||
@@ -81,7 +81,7 @@ complete -r -c terraform -n "__fish_seen_subcommand_from import" -o var-file -d
|
||||
complete -f -c terraform -n __fish_terraform_needs_command -a init -d "Initialize a new or existing Terraform configuration"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o backend=false -d "Disable backend initialization"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o cloud=false -d "Disable backend initialization"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o backend-config -d "Backend configuration"
|
||||
complete -r -c terraform -n "__fish_seen_subcommand_from init" -o backend-config -d "Backend configuration"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o force-copy -d "Suppress prompts about copying state data"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o from-module -d "Copy the module into target directory before init"
|
||||
complete -f -c terraform -n "__fish_seen_subcommand_from init" -o get=false -d "Disable downloading modules for this configuration"
|
||||
|
||||
@@ -62,7 +62,7 @@ packets:\t"Switch to the next file after it contains N packets"'
|
||||
complete -c $shark -s i -ra '(__fish_wireshark_interface)'
|
||||
complete -c $shark -s i -ra '-\t"Capture from standard input"' \
|
||||
-d 'Network interface or pipe to use for live packet capture'
|
||||
complete -c $shark -s I -l monitor-mode -d 'Put the interface in "monitor mode"' -xa '(__fish_wireshark_interface)'
|
||||
complete -c $shark -s I -l monitor-mode -d 'Put the interface in "monitor mode"'
|
||||
complete -c $shark -s L -l list-data-link-types -d 'List the data link types supported by the interface and exit'
|
||||
complete -c $shark -l list-time-stamp-types -d 'List time stamp types supported for the interface'
|
||||
complete -c $shark -s p -l no-promiscuous-mode -d "Don't put the interface into promiscuous mode"
|
||||
|
||||
@@ -126,8 +126,12 @@ function __fish_print_help --description "Print help message for the specified f
|
||||
end | string replace -ra '^ ' '' |
|
||||
begin
|
||||
set -l pager less
|
||||
# Try both PAGER and MANPAGER, last one wins
|
||||
set -q PAGER
|
||||
and echo $PAGER | read -at pager
|
||||
and echo -- $PAGER | read -at pager
|
||||
set -q MANPAGER
|
||||
and echo -- $MANPAGER | read -at pager
|
||||
|
||||
not isatty stdout
|
||||
and set pager cat # cannot use a builtin here
|
||||
# similar to man, but add -F to quit paging when the help output is brief (#6227)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
function __fish_print_portage_available_pkgs --description 'Print all available packages'
|
||||
find (__fish_print_portage_repository_paths) -mindepth 2 -maxdepth 2 -type d ! '(' '(' -path '*/eclass/*' -o -path '*/metadata/*' -o -path '*/profiles/*' -o -path '*/.*/*' ')' -prune ')' -printf '%P\n'
|
||||
set -l paths (__fish_print_portage_repository_paths)
|
||||
set -q paths[1]
|
||||
or return
|
||||
find $paths -mindepth 2 -maxdepth 2 -type d ! '(' '(' -path '*/eclass/*' -o -path '*/metadata/*' -o -path '*/profiles/*' -o -path '*/.*/*' ')' -prune ')' -printf '%P\n' 2>/dev/null
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
function __fish_print_portage_installed_pkgs --description 'Print all installed packages (non-deduplicated)'
|
||||
find /var/db/pkg -mindepth 2 -maxdepth 2 -type d -printf '%P\n' | string replace -r -- '-[0-9][0-9.]*.*$' ''
|
||||
find /var/db/pkg -mindepth 2 -maxdepth 2 -type d -printf '%P\n' 2>/dev/null | string replace -r -- '-[0-9][0-9.]*.*$' ''
|
||||
end
|
||||
|
||||
@@ -3,12 +3,14 @@ function __fish_print_portage_repository_paths --description 'Print the paths of
|
||||
set -l b
|
||||
set -l c /usr/share/portage/config/repos.conf
|
||||
test -d $a
|
||||
and set b (find $a -type f )
|
||||
and set b (find $a -type f 2>/dev/null)
|
||||
test -f $a
|
||||
and set b $a
|
||||
test -n "$b"
|
||||
and string match -q "[gentoo]" -- (cat $b)
|
||||
and string match -q "[gentoo]" -- (cat $b 2>/dev/null)
|
||||
and set c $b
|
||||
or set -a c $b
|
||||
cat $c | string match -g -r '^location = (.*$)'
|
||||
path is -r -- $c
|
||||
or return
|
||||
cat $c 2>/dev/null | string match -g -r '^location = (.*$)'
|
||||
end
|
||||
|
||||
@@ -106,7 +106,10 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
read -P"Overwrite prompt? [y/N]" -l yesno
|
||||
if string match -riq 'y(es)?' -- $yesno
|
||||
echo Overwriting
|
||||
cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}
|
||||
# Skip the cp if unnecessary,
|
||||
# or we'd throw an error on a stock fish.
|
||||
path is $__fish_config_dir/functions/fish_prompt.fish
|
||||
and cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}
|
||||
|
||||
set -l have
|
||||
if set -q argv[1]
|
||||
|
||||
@@ -14,7 +14,10 @@ function fish_default_key_bindings -d "emacs-like key binds"
|
||||
# This triggers the handler, which calls us again and ensures the user_key_bindings
|
||||
# are executed.
|
||||
set fish_key_bindings fish_default_key_bindings
|
||||
return
|
||||
# unless the handler somehow doesn't exist, which would leave us without bindings.
|
||||
# this happens in no-config mode.
|
||||
functions -q __fish_reload_key_bindings
|
||||
and return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,6 +61,7 @@ function fish_default_key_bindings -d "emacs-like key binds"
|
||||
bind --preset $argv \cf forward-char
|
||||
bind --preset $argv \cb backward-char
|
||||
bind --preset $argv \ct transpose-chars
|
||||
bind --preset $argv \cg cancel
|
||||
bind --preset $argv \c_ undo
|
||||
bind --preset $argv \cz undo
|
||||
bind --preset $argv \e/ redo
|
||||
|
||||
@@ -28,7 +28,10 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
# This triggers the handler, which calls us again and ensures the user_key_bindings
|
||||
# are executed.
|
||||
set fish_key_bindings fish_vi_key_bindings
|
||||
return
|
||||
# unless the handler somehow doesn't exist, which would leave us without bindings.
|
||||
# this happens in no-config mode.
|
||||
functions -q __fish_reload_key_bindings
|
||||
and return
|
||||
end
|
||||
|
||||
set -l init_mode insert
|
||||
|
||||
@@ -242,11 +242,6 @@ function help --description 'Show help for the fish shell'
|
||||
$fish_browser $page_url &
|
||||
disown $last_pid >/dev/null 2>&1
|
||||
else
|
||||
# Work around lynx bug where <div class="contents"> always has the same formatting as links (unreadable)
|
||||
# by using a custom style sheet. See https://github.com/fish-shell/fish-shell/issues/4170
|
||||
if string match -qr '^lynx' -- $fish_browser
|
||||
set fish_browser $fish_browser -lss={$__fish_data_dir}/lynx.lss
|
||||
end
|
||||
$fish_browser $page_url
|
||||
end
|
||||
end
|
||||
|
||||
104
share/lynx.lss
104
share/lynx.lss
@@ -1,104 +0,0 @@
|
||||
# Lynx Style Sheet
|
||||
# Used as a custom style sheet (LSS) for the Lynx browser to work around some
|
||||
# poor defaults. Usage: `lynx -lss=style.lss`
|
||||
#
|
||||
# The next line (beginning with "em") means: use bold if mono, otherwise
|
||||
# brightblue on <defaultbackground> (implicit)
|
||||
em:bold:brightblue
|
||||
strong:bold:brightred
|
||||
b:bold:red
|
||||
i:bold:brightblue
|
||||
a:bold:green
|
||||
img:dim:brown
|
||||
fig:normal:gray
|
||||
caption:reverse:brown
|
||||
hr:normal:yellow
|
||||
blockquote:normal:brightblue
|
||||
ul:normal:brown
|
||||
address:normal:magenta
|
||||
title:normal:magenta
|
||||
tt:dim:brightmagenta:default
|
||||
h1:bold:yellow
|
||||
h2:normal:brown
|
||||
h3:normal:green
|
||||
h4:normal:cyan
|
||||
label:normal:magenta
|
||||
q:normal:yellow
|
||||
small:dim:default
|
||||
big:bold:yellow
|
||||
sup:bold:yellow
|
||||
sub:dim:gray
|
||||
lh:bold:yellow
|
||||
li:normal:magenta
|
||||
code:normal:cyan
|
||||
cite:normal:cyan
|
||||
|
||||
table:normal:brightcyan
|
||||
tr:bold:brown
|
||||
td:normal:default
|
||||
br:normal:default
|
||||
|
||||
# Special styles - not corresponding directly to HTML tags
|
||||
# alert - status bar, when message begins "Alert".
|
||||
# alink - active link
|
||||
# normal - default attributes
|
||||
# status - status bar
|
||||
# whereis - whereis search target
|
||||
#
|
||||
#normal:normal:default:blue
|
||||
alink:reverse:yellow
|
||||
status:reverse:yellow
|
||||
alert:bold:yellow:red
|
||||
whereis:reverse+underline:magenta
|
||||
# currently not used
|
||||
#value:normal:green
|
||||
#high:bold:brightmagenta
|
||||
forwbackw.arrow:reverse
|
||||
|
||||
# Styles with classes - <ul class=red> etc.
|
||||
ul.red:underline:brightred
|
||||
ul.blue:bold:brightblue
|
||||
li.red:reverse:red
|
||||
li.blue:bold:blue
|
||||
strong.a:bold:black
|
||||
/* em.a:reverse:black */
|
||||
em.a:bold:bold
|
||||
strong.b:bold:white
|
||||
em.b:reverse:white
|
||||
strong.debug:reverse:green
|
||||
font.letter:normal:default
|
||||
input.submit:normal:cyan
|
||||
tr.baone:bold:yellow
|
||||
tr.batwo:bold:green
|
||||
tr.bathree:bold:red
|
||||
#
|
||||
# Special handling for link.
|
||||
link:normal:white
|
||||
link.green:bold:brightgreen
|
||||
link.red:bold:black
|
||||
link.blue:bold:white
|
||||
link.toc:bold:black:white
|
||||
# Special cases for link - the rel or title is appended after the class.
|
||||
# <link rel=next class=red href="1">
|
||||
link.red.next:bold:red
|
||||
link.red.prev:bold:yellow
|
||||
link.blue.prev:bold:yellow
|
||||
link.blue.next:bold:blue
|
||||
link.green.toc:bold:white
|
||||
#
|
||||
# Define styles that will be used when syntax highlighting is requested
|
||||
# (commandline option -prettysrc).
|
||||
span.htmlsrc_comment:normal:white
|
||||
span.htmlsrc_tag:normal:white
|
||||
#If you don't like that the tag name and attribute name are displayed
|
||||
#in different colors, comment the following line.
|
||||
span.htmlsrc_attrib:normal:cyan
|
||||
span.htmlsrc_attrval:normal:magenta
|
||||
span.htmlsrc_abracket:normal:white
|
||||
span.htmlsrc_entity:normal:white
|
||||
##span.htmlsrc_href:
|
||||
##span.htmlsrc_entire:
|
||||
span.htmlsrc_badseq:normal:red
|
||||
span.htmlsrc_badtag:normal:red
|
||||
span.htmlsrc_badattr:normal:red
|
||||
span.htmlsrc_sgmlspecial:normal:yellow
|
||||
@@ -293,19 +293,6 @@ body {
|
||||
border-bottom: #444 dotted 1px;
|
||||
}
|
||||
|
||||
.abbreviation_actions {
|
||||
width: 8em;
|
||||
text-align: right;
|
||||
border-bottom: #444 dotted 1px;
|
||||
}
|
||||
|
||||
.abbreviation_input {
|
||||
height: 1.5em;
|
||||
font: inherit;
|
||||
padding: 3px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* The CSS we apply when a table row is filtered */
|
||||
.data_table_row_filtered {
|
||||
display: none;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
<div ng-class="{'tab': true, 'selected_tab': currentTab == 'variables'}" id="tab_variables" ng-click="changeView('variables')">variables</div>
|
||||
<div ng-class="{'tab': true, 'selected_tab': currentTab == 'history'}" id="tab_history" ng-click="changeView('history')">history</div>
|
||||
<div ng-class="{'tab': true, 'selected_tab': currentTab == 'bindings'}" id="tab_bindings" ng-click="changeView('bindings')">bindings</div>
|
||||
<div ng-class="{'tab': true, 'selected_tab': currentTab == 'abbreviations'}" id="tab_abbreviations" ng-click="changeView('abbreviations')">abbreviations</div>
|
||||
</div>
|
||||
<div id="tab_contents">
|
||||
<ng-view></ng-view>
|
||||
|
||||
@@ -34,10 +34,6 @@ fishconfig.config(
|
||||
controller: "bindingsController",
|
||||
templateUrl: "partials/bindings.html"
|
||||
})
|
||||
.when("/abbreviations", {
|
||||
controller: "abbreviationsController",
|
||||
templateUrl: "partials/abbreviations.html"
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: "/colors"
|
||||
})
|
||||
|
||||
@@ -395,49 +395,3 @@ controllers.controller("bindingsController", function($scope, $http) {
|
||||
|
||||
$scope.fetchBindings();
|
||||
});
|
||||
|
||||
controllers.controller("abbreviationsController", function($scope, $http) {
|
||||
$scope.abbreviations = [];
|
||||
$scope.addBlank = function() {
|
||||
// Add blank entry if it is missing
|
||||
var hasBlank = {hasBlank: false}
|
||||
angular.forEach($scope.abbreviations, function(value, key) {
|
||||
if (value.phrase === "" && value.word === "") {
|
||||
this.hasBlank = true;
|
||||
}
|
||||
}, hasBlank);
|
||||
if (!$scope.abbreviations) $scope.abbreviations = [];
|
||||
if (! hasBlank.hasBlank) {
|
||||
$scope.abbreviations.push({phrase: "", word: "", editable: true})
|
||||
}
|
||||
}
|
||||
$scope.fetchAbbreviations = function() {
|
||||
$http.get("abbreviations/").then(function(arg) {
|
||||
$scope.abbreviations = arg.data;
|
||||
$scope.addBlank();
|
||||
})};
|
||||
|
||||
$scope.editAbbreviation = function(abbreviation) {
|
||||
abbreviation.editable = true;
|
||||
}
|
||||
|
||||
$scope.saveAbbreviation = function(abbreviation) {
|
||||
if (abbreviation.word && abbreviation.phrase) {
|
||||
$http.post("save_abbreviation/", abbreviation).then(function(arg) {
|
||||
abbreviation.editable = false;
|
||||
$scope.addBlank();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.removeAbbreviation = function(abbreviation) {
|
||||
if (abbreviation.word) {
|
||||
$http.post("remove_abbreviation/", abbreviation).then(function(arg) {
|
||||
$scope.abbreviations.splice($scope.abbreviations.indexOf(abbreviation), 1);
|
||||
$scope.addBlank();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.fetchAbbreviations();
|
||||
});
|
||||
|
||||
@@ -41,20 +41,3 @@ filters.filter("filterBinding", function() {
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
filters.filter("filterAbbreviations", function() {
|
||||
return function(abbreviations, query) {
|
||||
var result = []
|
||||
if (abbreviations == undefined) return result;
|
||||
if (query == null) { return abbreviations};
|
||||
|
||||
for(var i=0; i<abbreviations.length; ++i) {
|
||||
var abbr = abbreviations[i];
|
||||
if (abbr.word.toLowerCase().indexOf(query) != -1 || abbr.phrase.toLowerCase().indexOf(query.toLowerCase()) != -1) {
|
||||
result.push(abbr);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<div id="table_filter_container" style="display: block;">
|
||||
<input id="table_filter_text_box" class="filter_text_box text_box_transient" placeholder="Filter" ng-model="query">
|
||||
</div>
|
||||
|
||||
<table class="data_table">
|
||||
<tbody>
|
||||
<tr class="data_table_row" ng-repeat="abbreviation in abbreviations | filterAbbreviations:query" ng-click="editAbbreviation(abbreviation)">
|
||||
<td ng-class="{ data_table_cell: true }" style="text-align: right; padding-right: 30px;">
|
||||
<span ng-hide="abbreviation.editable">{{ abbreviation.word }}</span>
|
||||
<span ng-show="abbreviation.editable"><input ng-model="abbreviation.word" class="abbreviation_input" style="text-align: right; min-width: 10em;"></span>
|
||||
</td>
|
||||
<td ng-class="{ data_table_cell: true }" style="text-align: left; padding-right: 30px;">
|
||||
<span ng-hide="abbreviation.editable">{{ abbreviation.phrase }}</span>
|
||||
<span ng-show="abbreviation.editable"><input ng-model="abbreviation.phrase" class="abbreviation_input" style="text-align: left; min-width: 22em;"></span>
|
||||
</td>
|
||||
<td ng-class="{ data_table_cell: true }" class="abbreviation_actions">
|
||||
<span ng-show="abbreviation.editable && abbreviation.word && abbreviation.phrase" ng-click="saveAbbreviation(abbreviation)"><button class="save_button" style="margin: inherit;">Save</button></span>
|
||||
<a ng-show="abbreviation.word" ng-click="removeAbbreviation(abbreviation)"><img alt="Delete" src="delete.png" style="vertical-align: text-bottom"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -36,7 +36,7 @@ function fish_prompt
|
||||
|
||||
# Prompt status only if it's not 0
|
||||
set -l prompt_status
|
||||
test $last_status -ne 0; and set prompt_status (set_color $fish_color_error)"[$last_status]$normal"
|
||||
test $last_status -ne 0; and set prompt_status (set_color $fish_color_status)"[$last_status]$normal"
|
||||
|
||||
# Only show host if in SSH or container
|
||||
# Store this in a global variable because it's slow and unchanging
|
||||
|
||||
@@ -21,7 +21,7 @@ fish_color_quote 9ce781
|
||||
fish_color_redirection FFF
|
||||
fish_color_search_match --background=533
|
||||
fish_color_selection --background=B218B2
|
||||
fish_color_status '--background=red' 'white'
|
||||
fish_color_status F22
|
||||
fish_color_user brgreen
|
||||
fish_color_valid_path --underline
|
||||
fish_pager_color_completion BBB
|
||||
|
||||
@@ -1338,40 +1338,6 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
result.extend([self.read_one_sample_prompt(path) for path in paths])
|
||||
return result
|
||||
|
||||
def do_get_abbreviations(self):
|
||||
# Example abbreviation line:
|
||||
# abbr -a -U -- ls 'ls -a'
|
||||
result = []
|
||||
out, err = run_fish_cmd("abbr --show")
|
||||
for line in out.rstrip().split("\n"):
|
||||
if not line:
|
||||
continue
|
||||
_, abbr = line.split(" -- ", 1)
|
||||
word, phrase = abbr.split(" ", 1)
|
||||
result.append({"word": word, "phrase": phrase})
|
||||
return result
|
||||
|
||||
def do_remove_abbreviation(self, abbreviation):
|
||||
out, err = run_fish_cmd("abbr --erase %s" % abbreviation["word"])
|
||||
if err:
|
||||
return err
|
||||
else:
|
||||
return None
|
||||
|
||||
def do_save_abbreviation(self, abbreviation):
|
||||
out, err = run_fish_cmd(
|
||||
# Remove one layer of single-quotes because escape_fish_cmd adds them back.
|
||||
"abbr --add %s %s"
|
||||
% (
|
||||
escape_fish_cmd(strip_one_layer(abbreviation["word"], "'")),
|
||||
escape_fish_cmd(strip_one_layer(abbreviation["phrase"], "'")),
|
||||
)
|
||||
)
|
||||
if err:
|
||||
return err
|
||||
else:
|
||||
return None
|
||||
|
||||
def secure_startswith(self, haystack, needle):
|
||||
if len(haystack) < len(needle):
|
||||
return False
|
||||
@@ -1453,8 +1419,6 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
output = self.do_get_color_for_variable(name)
|
||||
elif p == "/bindings/":
|
||||
output = self.do_get_bindings()
|
||||
elif p == "/abbreviations/":
|
||||
output = self.do_get_abbreviations()
|
||||
else:
|
||||
return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
|
||||
|
||||
@@ -1577,18 +1541,6 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
output = ["OK"]
|
||||
else:
|
||||
output = ["Unable to set prompt"]
|
||||
elif p == "/save_abbreviation/":
|
||||
errmsg = self.do_save_abbreviation(postvars)
|
||||
if errmsg:
|
||||
output = [errmsg]
|
||||
else:
|
||||
output = ["OK"]
|
||||
elif p == "/remove_abbreviation/":
|
||||
errmsg = self.do_remove_abbreviation(postvars)
|
||||
if errmsg:
|
||||
output = [errmsg]
|
||||
else:
|
||||
output = ["OK"]
|
||||
else:
|
||||
return self.send_error(404)
|
||||
|
||||
@@ -1701,7 +1653,6 @@ if len(sys.argv) > 1:
|
||||
"variables",
|
||||
"history",
|
||||
"bindings",
|
||||
"abbreviations",
|
||||
]:
|
||||
if tab.startswith(sys.argv[1]):
|
||||
initial_tab = "#!/" + tab
|
||||
|
||||
@@ -144,14 +144,14 @@ int parse_help_only_cmd_opts(struct help_only_cmd_opts_t &opts, int *optind, int
|
||||
///
|
||||
/// Process and print help for the specified builtin or function.
|
||||
void builtin_print_help(parser_t &parser, const io_streams_t &streams, const wchar_t *name,
|
||||
wcstring *error_message) {
|
||||
const wcstring &error_message) {
|
||||
// This won't ever work if no_exec is set.
|
||||
if (no_exec()) return;
|
||||
const wcstring name_esc = escape_string(name);
|
||||
wcstring cmd = format_string(L"__fish_print_help %ls ", name_esc.c_str());
|
||||
io_chain_t ios;
|
||||
if (error_message) {
|
||||
cmd.append(escape_string(*error_message));
|
||||
if (!error_message.empty()) {
|
||||
cmd.append(escape_string(error_message));
|
||||
// If it's an error, redirect the output of __fish_print_help to stderr
|
||||
ios.push_back(std::make_shared<io_fd_t>(STDOUT_FILENO, STDERR_FILENO));
|
||||
}
|
||||
@@ -268,7 +268,7 @@ static maybe_t<int> builtin_break_continue(parser_t &parser, io_streams_t &strea
|
||||
|
||||
if (argc != 1) {
|
||||
wcstring error_message = format_string(BUILTIN_ERR_UNKNOWN, argv[0], argv[1]);
|
||||
builtin_print_help(parser, streams, argv[0], &error_message);
|
||||
builtin_print_help(parser, streams, argv[0], error_message);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ static maybe_t<int> builtin_break_continue(parser_t &parser, io_streams_t &strea
|
||||
}
|
||||
if (!has_loop) {
|
||||
wcstring error_message = format_string(_(L"%ls: Not inside of loop\n"), argv[0]);
|
||||
builtin_print_help(parser, streams, argv[0], &error_message);
|
||||
builtin_print_help(parser, streams, argv[0], error_message);
|
||||
return STATUS_CMD_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ const wchar_t *builtin_get_desc(const wcstring &name);
|
||||
wcstring builtin_help_get(parser_t &parser, const wchar_t *cmd);
|
||||
|
||||
void builtin_print_help(parser_t &parser, const io_streams_t &streams, const wchar_t *name,
|
||||
wcstring *error_message = nullptr);
|
||||
const wcstring &error_message = {});
|
||||
int builtin_count_args(const wchar_t *const *argv);
|
||||
|
||||
void builtin_unknown_option(parser_t &parser, io_streams_t &streams, const wchar_t *cmd,
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "../common.h"
|
||||
#include "../env.h"
|
||||
#include "../io.h"
|
||||
#include "../parser.h"
|
||||
#include "../re.h"
|
||||
#include "../wcstringutil.h"
|
||||
#include "../wgetopt.h"
|
||||
@@ -98,7 +99,6 @@ static int abbr_show(const abbr_options_t &, io_streams_t &streams) {
|
||||
for (const auto &abbr : abbrs->list()) {
|
||||
comps.clear();
|
||||
comps.push_back(L"abbr -a");
|
||||
if (abbr.from_universal) comps.push_back(L"-U");
|
||||
if (abbr.is_regex()) {
|
||||
comps.push_back(L"--regex");
|
||||
comps.push_back(escape_string(abbr.key));
|
||||
@@ -121,6 +121,7 @@ static int abbr_show(const abbr_options_t &, io_streams_t &streams) {
|
||||
if (!abbr.replacement_is_function) {
|
||||
comps.push_back(escape_string(abbr.replacement));
|
||||
}
|
||||
if (abbr.from_universal) comps.push_back(_(L"# imported from a universal variable, see `help abbr`"));
|
||||
wcstring result = join_strings(comps, L' ');
|
||||
result.push_back(L'\n');
|
||||
streams.out.append(result);
|
||||
@@ -138,7 +139,7 @@ static int abbr_list(const abbr_options_t &opts, io_streams_t &streams) {
|
||||
}
|
||||
const auto abbrs = abbrs_get_set();
|
||||
for (const auto &abbr : abbrs->list()) {
|
||||
wcstring name = escape_string(abbr.name);
|
||||
wcstring name = abbr.name;
|
||||
name.push_back(L'\n');
|
||||
streams.out.append(name);
|
||||
}
|
||||
@@ -201,11 +202,12 @@ static int abbr_add(const abbr_options_t &opts, io_streams_t &streams) {
|
||||
streams.err.append_format(_(L"%ls %ls: Requires at least two arguments\n"), CMD, subcmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
const wcstring &name = opts.args[0];
|
||||
if (name.empty()) {
|
||||
|
||||
if (opts.args.empty() || opts.args[0].empty()) {
|
||||
streams.err.append_format(_(L"%ls %ls: Name cannot be empty\n"), CMD, subcmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
const wcstring &name = opts.args[0];
|
||||
if (std::any_of(name.begin(), name.end(), iswspace)) {
|
||||
streams.err.append_format(
|
||||
_(L"%ls %ls: Abbreviation '%ls' cannot have spaces in the word\n"), CMD, subcmd,
|
||||
@@ -269,7 +271,7 @@ static int abbr_add(const abbr_options_t &opts, io_streams_t &streams) {
|
||||
}
|
||||
|
||||
// Erase the named abbreviations.
|
||||
static int abbr_erase(const abbr_options_t &opts, io_streams_t &) {
|
||||
static int abbr_erase(const abbr_options_t &opts, parser_t &parser, io_streams_t &) {
|
||||
if (opts.args.empty()) {
|
||||
// This has historically been a silent failure.
|
||||
return STATUS_CMD_ERROR;
|
||||
@@ -282,6 +284,14 @@ static int abbr_erase(const abbr_options_t &opts, io_streams_t &) {
|
||||
if (!abbrs->erase(arg)) {
|
||||
result = ENV_NOT_FOUND;
|
||||
}
|
||||
// Erase the old uvar - this makes `abbr -e` work.
|
||||
wcstring esc_src = escape_string(arg, 0, STRING_STYLE_VAR);
|
||||
if (!esc_src.empty()) {
|
||||
wcstring var_name = L"_fish_abbr_" + esc_src;
|
||||
auto ret = parser.vars().remove(var_name, ENV_UNIVERSAL);
|
||||
if (ret == ENV_OK) result = STATUS_CMD_OK;
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -384,9 +394,15 @@ maybe_t<int> builtin_abbr(parser_t &parser, io_streams_t &streams, const wchar_t
|
||||
opts.list = true;
|
||||
break;
|
||||
case 'g':
|
||||
case 'U':
|
||||
// Kept for backwards compatibility but ignored.
|
||||
// This basically does nothing now.
|
||||
break;
|
||||
case 'U': {
|
||||
// Kept and made ineffective, so we warn.
|
||||
streams.err.append_format(_(L"%ls: Warning: Option '%ls' was removed and is now ignored"), cmd, argv[w.woptind - 1]);
|
||||
builtin_print_error_trailer(parser, streams.err, cmd);
|
||||
break;
|
||||
}
|
||||
case 'h': {
|
||||
builtin_print_help(parser, streams, cmd);
|
||||
return STATUS_CMD_OK;
|
||||
@@ -410,7 +426,7 @@ maybe_t<int> builtin_abbr(parser_t &parser, io_streams_t &streams, const wchar_t
|
||||
if (opts.show) return abbr_show(opts, streams);
|
||||
if (opts.list) return abbr_list(opts, streams);
|
||||
if (opts.rename) return abbr_rename(opts, streams);
|
||||
if (opts.erase) return abbr_erase(opts, streams);
|
||||
if (opts.erase) return abbr_erase(opts, parser, streams);
|
||||
if (opts.query) return abbr_query(opts, streams);
|
||||
|
||||
// validate() should error or ensure at least one path is set.
|
||||
|
||||
@@ -27,7 +27,7 @@ static int send_to_bg(parser_t &parser, io_streams_t &streams, job_t *j) {
|
||||
wcstring error_message = format_string(
|
||||
_(L"%ls: Can't put job %d, '%ls' to background because it is not under job control\n"),
|
||||
L"bg", j->job_id(), j->command_wcstr());
|
||||
builtin_print_help(parser, streams, L"bg", &error_message);
|
||||
builtin_print_help(parser, streams, L"bg", error_message);
|
||||
return STATUS_CMD_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -424,6 +424,11 @@ static int validate_read_args(const wchar_t *cmd, read_cmd_opts_t &opts, int arg
|
||||
builtin_print_error_trailer(parser, streams.err, cmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
if (env_var_t::flags_for(argv[i]) & env_var_t::flag_read_only) {
|
||||
streams.err.append_format(_(L"%ls: %ls: cannot overwrite read-only variable"), cmd, argv[i]);
|
||||
builtin_print_error_trailer(parser, streams.err, cmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_CMD_OK;
|
||||
|
||||
@@ -303,16 +303,6 @@ static wcstring str2wcs_internal(const char *in, const size_t in_len) {
|
||||
wcstring result;
|
||||
result.reserve(in_len);
|
||||
|
||||
// In the unlikely event that MB_CUR_MAX is 1, then we are just going to append.
|
||||
if (MB_CUR_MAX == 1) {
|
||||
size_t in_pos = 0;
|
||||
while (in_pos < in_len) {
|
||||
result.push_back(static_cast<unsigned char>(in[in_pos]));
|
||||
in_pos++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t in_pos = 0;
|
||||
mbstate_t state = {};
|
||||
while (in_pos < in_len) {
|
||||
|
||||
@@ -97,45 +97,4 @@ class enum_array_t : public std::array<Elem, enum_count<T>()> {
|
||||
const Elem &operator[](T t) const { return super::operator[](index_of(t)); }
|
||||
};
|
||||
|
||||
/// A counting iterator for an enum class.
|
||||
/// This enumerates the values of an enum class from 0 up to (not including) count.
|
||||
/// Example:
|
||||
/// for (auto v : enum_iter_t<MyEnum>) {...}
|
||||
template <typename T>
|
||||
class enum_iter_t {
|
||||
using base_type_t = typename std::underlying_type<T>::type;
|
||||
struct iterator_t {
|
||||
friend class enum_iter_t;
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using value_type = T;
|
||||
using difference_type = long;
|
||||
|
||||
explicit iterator_t(base_type_t v) : v_(v) {}
|
||||
|
||||
T operator*() const { return static_cast<T>(v_); }
|
||||
const T *operator->() const { return static_cast<const T *>(v_); }
|
||||
|
||||
iterator_t &operator++() {
|
||||
v_ += 1;
|
||||
return *this;
|
||||
}
|
||||
|
||||
const iterator_t operator++(int) {
|
||||
auto res = *this;
|
||||
v_ += 1;
|
||||
return res;
|
||||
}
|
||||
|
||||
bool operator==(iterator_t rhs) const { return v_ == rhs.v_; }
|
||||
bool operator!=(iterator_t rhs) const { return v_ != rhs.v_; }
|
||||
|
||||
private:
|
||||
base_type_t v_{};
|
||||
};
|
||||
|
||||
public:
|
||||
iterator_t begin() const { return iterator_t{0}; }
|
||||
iterator_t end() const { return iterator_t{static_cast<base_type_t>(enum_count<T>())}; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -376,10 +376,9 @@ void env_init(const struct config_paths_t *paths, bool do_uvars, bool default_pa
|
||||
if (is_interactive_session()) {
|
||||
wcstring nshlvl_str = L"1";
|
||||
if (const char *shlvl_var = getenv("SHLVL")) {
|
||||
const wchar_t *end;
|
||||
// TODO: Figure out how to handle invalid numbers better. Shouldn't we issue a
|
||||
// diagnostic?
|
||||
long shlvl_i = fish_wcstol(str2wcstring(shlvl_var).c_str(), &end);
|
||||
long shlvl_i = fish_wcstol(str2wcstring(shlvl_var).c_str());
|
||||
if (!errno && shlvl_i >= 0) {
|
||||
nshlvl_str = to_string(shlvl_i + 1);
|
||||
}
|
||||
|
||||
@@ -431,9 +431,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
// struct stat tmp;
|
||||
// stat("----------FISH_HIT_MAIN----------", &tmp);
|
||||
|
||||
const char *dummy_argv[2] = {"fish", nullptr};
|
||||
if (!argv[0]) {
|
||||
argv = const_cast<char **>(dummy_argv); //!OCLINT(parameter reassignment)
|
||||
@@ -491,8 +488,6 @@ int main(int argc, char **argv) {
|
||||
// If we're not executing, there's no need to find the config.
|
||||
if (!opts.no_exec) {
|
||||
paths = determine_config_directory_paths(argv[0]);
|
||||
}
|
||||
if (!opts.no_exec) {
|
||||
env_init(&paths, /* do uvars */ !opts.no_config, /* default paths */ opts.no_config);
|
||||
}
|
||||
|
||||
|
||||
@@ -347,13 +347,6 @@ static void test_enum_set() {
|
||||
do_test((enum_set_t<test_enum>{test_enum::beta} | test_enum::alpha).to_raw() == 3);
|
||||
do_test((enum_set_t<test_enum>{test_enum::beta} | enum_set_t<test_enum>{test_enum::alpha})
|
||||
.to_raw() == 3);
|
||||
|
||||
unsigned idx = 0;
|
||||
for (auto v : enum_iter_t<test_enum>{}) {
|
||||
do_test(static_cast<unsigned>(v) == idx);
|
||||
idx++;
|
||||
}
|
||||
do_test(static_cast<unsigned>(test_enum::COUNT) == idx);
|
||||
}
|
||||
|
||||
static void test_enum_array() {
|
||||
|
||||
@@ -450,7 +450,7 @@ end_execution_reason_t parse_execution_context_t::run_for_statement(
|
||||
auto var = parser->vars().get(for_var_name, ENV_DEFAULT);
|
||||
if (env_var_t::flags_for(for_var_name.c_str()) & env_var_t::flag_read_only) {
|
||||
return report_error(STATUS_INVALID_ARGS, header.var_name,
|
||||
L"for: %ls: cannot overwrite read-only variable", for_var_name.c_str());
|
||||
_(L"%ls: %ls: cannot overwrite read-only variable"), L"for", for_var_name.c_str());
|
||||
}
|
||||
|
||||
auto &vars = parser->vars();
|
||||
|
||||
@@ -453,6 +453,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||
break;
|
||||
}
|
||||
|
||||
case EACCES:
|
||||
case ENOENT: {
|
||||
// ENOENT is returned by exec() when the path fails, but also returned by posix_spawn if
|
||||
// an open file action fails. These cases appear to be impossible to distinguish. We
|
||||
@@ -461,7 +462,9 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||
char interpreter_buff[128] = {};
|
||||
const char *interpreter =
|
||||
get_interpreter(actual_cmd, interpreter_buff, sizeof interpreter_buff);
|
||||
if (interpreter && 0 != access(interpreter, X_OK)) {
|
||||
struct stat buf;
|
||||
auto statret = stat(interpreter, &buf);
|
||||
if (interpreter && (0 != statret || access(interpreter, X_OK))) {
|
||||
// Detect Windows line endings and complain specifically about them.
|
||||
auto len = strlen(interpreter);
|
||||
if (len && interpreter[len - 1] == '\r') {
|
||||
@@ -476,29 +479,31 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||
"executable command.",
|
||||
actual_cmd, interpreter);
|
||||
}
|
||||
} else if (interpreter && S_ISDIR(buf.st_mode)) {
|
||||
FLOGF_SAFE(exec,
|
||||
"Failed to execute process '%s': The file specified the interpreter "
|
||||
"'%s', which is a directory.",
|
||||
actual_cmd, interpreter);
|
||||
} else if (access(actual_cmd, X_OK) == 0) {
|
||||
FLOGF_SAFE(exec,
|
||||
"Failed to execute process '%s': The file exists and is executable. "
|
||||
"Check the interpreter or linker?",
|
||||
actual_cmd);
|
||||
} else {
|
||||
} else if (err == ENOENT) {
|
||||
FLOGF_SAFE(exec,
|
||||
"Failed to execute process '%s': The file does not exist or could not "
|
||||
"be executed.",
|
||||
actual_cmd);
|
||||
} else {
|
||||
FLOGF_SAFE(exec, "Failed to execute process '%s': The file could not be accessed.",
|
||||
actual_cmd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ENOMEM: {
|
||||
FLOGF_SAFE(exec, "Out of memory");
|
||||
break;
|
||||
}
|
||||
case EACCES: {
|
||||
FLOGF_SAFE(exec, "Failed to execute process '%s': The file could not be accessed.",
|
||||
actual_cmd);
|
||||
break;
|
||||
}
|
||||
case ETXTBSY: {
|
||||
FLOGF_SAFE(exec, "Failed to execute process '%s': File is currently open for writing.",
|
||||
actual_cmd);
|
||||
|
||||
@@ -509,9 +509,6 @@ class job_t : noncopyable_t {
|
||||
/// \return whether we should post job_exit events.
|
||||
bool posts_job_exit_events() const;
|
||||
|
||||
/// \return whether this job and its parent chain are fully constructed.
|
||||
bool job_chain_is_fully_constructed() const;
|
||||
|
||||
/// Run ourselves. Returning once we complete or stop.
|
||||
void continue_job(parser_t &parser);
|
||||
|
||||
|
||||
@@ -251,7 +251,8 @@ maybe_t<wcstring> regex_t::substitute(const wcstring &subject, const wcstring &r
|
||||
error_code_t rc =
|
||||
pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options,
|
||||
nullptr /* match_data */, nullptr /* context */, to_sptr(replacement),
|
||||
replacement.size(), reinterpret_cast<PCRE2_UCHAR32 *>(buffer), &bufflen);
|
||||
// (not using UCHAR32 here for cygwin's benefit)
|
||||
replacement.size(), reinterpret_cast<PCRE2_UCHAR *>(buffer), &bufflen);
|
||||
|
||||
if (out_repl_count) {
|
||||
*out_repl_count = std::max(rc, 0);
|
||||
@@ -270,7 +271,7 @@ maybe_t<wcstring> regex_t::substitute(const wcstring &subject, const wcstring &r
|
||||
wcstring res(bufflen, L'\0');
|
||||
rc = pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options,
|
||||
nullptr /* match_data */, nullptr /* context */, to_sptr(replacement),
|
||||
replacement.size(), reinterpret_cast<PCRE2_UCHAR32 *>(&res[0]),
|
||||
replacement.size(), reinterpret_cast<PCRE2_UCHAR *>(&res[0]),
|
||||
&bufflen);
|
||||
if (out_repl_count) {
|
||||
*out_repl_count = std::max(rc, 0);
|
||||
|
||||
@@ -1277,9 +1277,14 @@ static history_pager_result_t history_pager_search(const std::shared_ptr<history
|
||||
history_search_direction_t direction,
|
||||
size_t history_index,
|
||||
const wcstring &search_string) {
|
||||
// Use a small page size because we don't always offer practical ways to select a item from
|
||||
// a large page (since we don't support subsequence filtering here).
|
||||
constexpr size_t page_size = 12;
|
||||
// Limit the number of elements to half the screen like we do for completions
|
||||
// Note that this is imperfect because we could have a multi-column layout.
|
||||
//
|
||||
// We can still push fish further upward in case the first entry is multiline,
|
||||
// but that can't really be helped.
|
||||
// (subtract 2 for the search line and the prompt)
|
||||
size_t page_size = std::max(termsize_last().height / 2 - 2, 12);
|
||||
|
||||
completion_list_t completions;
|
||||
history_search_t search{history, search_string, history_search_type_t::contains,
|
||||
smartcase_flags(search_string), history_index};
|
||||
@@ -4477,7 +4482,8 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
|
||||
|
||||
// Clear the pager if necessary.
|
||||
bool focused_on_search_field = (active_edit_line() == &pager.search_field_line);
|
||||
if (command_ends_paging(readline_cmd, focused_on_search_field)) {
|
||||
if (!history_search.active() &&
|
||||
command_ends_paging(readline_cmd, focused_on_search_field)) {
|
||||
clear_pager();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
// This version was altered and ported to C++ for inclusion in fish.
|
||||
|
||||
#ifndef __TINYEXPR_H__
|
||||
#define __TINYEXPR_H__
|
||||
#ifndef TINYEXPR_H
|
||||
#define TINYEXPR_H
|
||||
|
||||
typedef enum {
|
||||
TE_ERROR_NONE = 0,
|
||||
@@ -51,4 +51,4 @@ typedef struct te_error_t {
|
||||
/* Returns NaN on error. */
|
||||
double te_interp(const wchar_t *expression, te_error_t *error);
|
||||
|
||||
#endif /*__TINYEXPR_H__*/
|
||||
#endif /* TINYEXPR_H */
|
||||
|
||||
@@ -679,7 +679,7 @@ class wildcard_expander_t {
|
||||
}
|
||||
|
||||
// Helper to resolve using our prefix.
|
||||
dir_iter_t open_dir(const wcstring &base_dir) const {
|
||||
dir_iter_t open_dir(const wcstring &base_dir, bool dotdot = false) const {
|
||||
wcstring path = this->working_directory;
|
||||
append_path_component(path, base_dir);
|
||||
if (flags & expand_flag::special_for_cd) {
|
||||
@@ -687,7 +687,7 @@ class wildcard_expander_t {
|
||||
// for example, cd ../<tab> should complete "without resolving symlinks".
|
||||
path = normalize_path(path);
|
||||
}
|
||||
return dir_iter_t(path);
|
||||
return dir_iter_t(path, dotdot);
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -952,7 +952,8 @@ void wildcard_expander_t::expand(const wcstring &base_dir, const wchar_t *wc,
|
||||
}
|
||||
}
|
||||
|
||||
dir_iter_t dir = open_dir(base_dir);
|
||||
// return "." and ".." entries if we're doing completions
|
||||
dir_iter_t dir = open_dir(base_dir, /* return . and .. */ flags & expand_flag::for_completions);
|
||||
if (dir.valid()) {
|
||||
if (is_last_segment) {
|
||||
// Last wildcard segment, nonempty wildcard.
|
||||
|
||||
@@ -172,12 +172,13 @@ void dir_iter_t::entry_t::do_stat() const {
|
||||
}
|
||||
}
|
||||
|
||||
dir_iter_t::dir_iter_t(const wcstring &path) {
|
||||
dir_iter_t::dir_iter_t(const wcstring &path, bool withdot) {
|
||||
dir_.reset(wopendir(path));
|
||||
if (!dir_) {
|
||||
error_ = errno;
|
||||
return;
|
||||
}
|
||||
withdot_ = withdot;
|
||||
entry_.dirfd_ = dirfd(&*dir_);
|
||||
}
|
||||
|
||||
@@ -211,8 +212,9 @@ const dir_iter_t::entry_t *dir_iter_t::next() {
|
||||
error_ = errno;
|
||||
return nullptr;
|
||||
}
|
||||
// Skip . and ..
|
||||
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) {
|
||||
// Skip . and ..,
|
||||
// unless we've been told not to.
|
||||
if (!withdot_ && (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))) {
|
||||
return next();
|
||||
}
|
||||
entry_.reset();
|
||||
|
||||
@@ -171,12 +171,15 @@ enum class dir_entry_type_t : uint8_t {
|
||||
/// symlink, or if the caller asks for the stat buffer.
|
||||
/// Symlinks are followed.
|
||||
class dir_iter_t : noncopyable_t {
|
||||
private:
|
||||
/// Whether this dir_iter considers the "." and ".." filesystem entries.
|
||||
bool withdot_{false};
|
||||
public:
|
||||
struct entry_t;
|
||||
|
||||
/// Open a directory at a given path. On failure, \p error() will return the error code.
|
||||
/// Note opendir is guaranteed to set close-on-exec by POSIX (hooray).
|
||||
explicit dir_iter_t(const wcstring &path);
|
||||
explicit dir_iter_t(const wcstring &path, bool withdot = false);
|
||||
|
||||
/// Advance this iterator.
|
||||
/// \return a pointer to the entry, or nullptr if the entry is finished, or an error occurred.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
set -U _fish_abbr_cuckoo somevalue
|
||||
set fish (status fish-path)
|
||||
$fish -c abbr
|
||||
# CHECK: abbr -a -U -- cuckoo somevalue
|
||||
# CHECK: abbr -a -- cuckoo somevalue # imported from a universal variable, see `help abbr`
|
||||
|
||||
# Test basic add and list of __abbr1
|
||||
abbr __abbr1 alpha beta gamma
|
||||
@@ -170,7 +170,23 @@ abbr --show
|
||||
# CHECK: abbr -a -- nonregex_name foo
|
||||
# CHECK: abbr -a --regex 'A[0-9]B' -- regex_name bar
|
||||
# CHECK: abbr -a --position anywhere --function replace_history -- !!
|
||||
|
||||
# Confirm that this erases the old uvar
|
||||
# (slightly cheating since we haven't imported it as an abbr,
|
||||
# but that's okay)
|
||||
abbr --erase cuckoo
|
||||
echo erase $status
|
||||
# CHECK: erase 0
|
||||
set --show _fish_abbr_cuckoo
|
||||
# Nothing
|
||||
|
||||
abbr --add '$PAGER' less
|
||||
abbr --erase (abbr --list)
|
||||
abbr --list
|
||||
# Nothing
|
||||
abbr --add '$PAGER' less
|
||||
abbr --list
|
||||
# CHECK: $PAGER
|
||||
|
||||
abbr --add bogus --position never stuff
|
||||
# CHECKERR: abbr: Invalid position 'never'
|
||||
@@ -178,3 +194,8 @@ abbr --add bogus --position never stuff
|
||||
|
||||
abbr --add bogus --position anywhere --position command stuff
|
||||
# CHECKERR: abbr: Cannot specify multiple positions
|
||||
|
||||
abbr --add --regex foo --function foo
|
||||
# CHECKERR: abbr --add: Name cannot be empty
|
||||
echo foo
|
||||
# CHECK: foo
|
||||
|
||||
@@ -267,3 +267,7 @@ begin
|
||||
# CHECK: $PWD is absolute
|
||||
cd ../../..
|
||||
end
|
||||
|
||||
complete -C'cd .'
|
||||
# CHECK: ../
|
||||
# CHECK: ./
|
||||
|
||||
@@ -33,6 +33,19 @@ git init >/dev/null 2>&1
|
||||
# First set up a test alias - *before loading the completions*
|
||||
git config --local alias.re 'restore --staged'
|
||||
|
||||
# Test custom command completions by adding a command:
|
||||
|
||||
set -p PATH $PWD
|
||||
echo "echo foo" > git-frobnicate
|
||||
chmod +x git-frobnicate
|
||||
|
||||
complete -c git-frobnicate -xa 'foo bar baz'
|
||||
|
||||
complete -C'git frobnicate '
|
||||
#CHECK: bar
|
||||
#CHECK: baz
|
||||
#CHECK: foo
|
||||
|
||||
complete -C'git ' | grep '^add'\t
|
||||
# (note: actual tab character in the check here)
|
||||
#CHECK: add Add file contents to the staging area
|
||||
@@ -41,9 +54,11 @@ touch foo
|
||||
|
||||
complete -C'git add '
|
||||
#CHECK: foo Untracked file
|
||||
#CHECK: git-frobnicate Untracked file
|
||||
|
||||
complete -C'git add :'
|
||||
#CHECK: :/:foo Untracked file
|
||||
#CHECK: :/:git-frobnicate Untracked file
|
||||
|
||||
git config alias.s status
|
||||
complete 'git s --s'
|
||||
@@ -71,7 +86,7 @@ set -g __fish_git_prompt_show_informative_status 1
|
||||
set -g __fish_git_prompt_showuntrackedfiles 1
|
||||
fish_git_prompt
|
||||
echo
|
||||
#CHECK: (newbranch|…1)
|
||||
#CHECK: (newbranch|…2)
|
||||
set -e __fish_git_prompt_show_informative_status
|
||||
set -e __fish_git_prompt_showuntrackedfiles
|
||||
|
||||
|
||||
@@ -380,3 +380,12 @@ begin
|
||||
end | read -l --line foo bar
|
||||
echo $foo $bar
|
||||
# CHECK: 1 2
|
||||
|
||||
echo foo | read status
|
||||
# CHECKERR: read: status: cannot overwrite read-only variable
|
||||
# CHECKERR: {{.*}}read.fish (line {{\d+}}):
|
||||
# CHECKERR: echo foo | read status
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: (Type 'help read' for related documentation)
|
||||
echo read $status
|
||||
# CHECK: read 2
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# disable on github actions because it's flakey
|
||||
#REQUIRES: test -z "$CI"
|
||||
|
||||
set -g isolated_tmux_fish_extra_args -C '
|
||||
set -g fish_autosuggestion_enabled 0
|
||||
'
|
||||
isolated-tmux-start
|
||||
|
||||
isolated-tmux send-keys 'true needle' Enter
|
||||
@@ -15,3 +18,12 @@ isolated-tmux send-keys C-p C-a M-f M-f M-f M-.
|
||||
# CHECK: prompt 2> true hay needle hay
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p
|
||||
|
||||
isolated-tmux send-keys C-e C-u true Up Up Escape
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p | grep 'prompt 2'
|
||||
# CHECK: prompt 2> true
|
||||
isolated-tmux send-keys C-z _
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p | grep 'prompt 2'
|
||||
# CHECK: prompt 2> _
|
||||
|
||||
@@ -76,7 +76,7 @@ send("sleep 131 & echo $last_pid\r")
|
||||
pids += [expect_re("\d+\r\n").group().strip()]
|
||||
expect_prompt()
|
||||
send("sleep 9999999\r")
|
||||
sleep(0.300) # ensure fish kicks off the above sleep before it gets HUP - see #7288
|
||||
sleep(0.500) # ensure fish kicks off the above sleep before it gets HUP - see #7288
|
||||
os.kill(sp.spawn.pid, signal.SIGHUP)
|
||||
|
||||
# Verify the spawned fish shell has exited.
|
||||
|
||||
Reference in New Issue
Block a user