mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 12:11:20 -03:00
docs: Fix markup for code blocks
This commit is contained in:
committed by
Fabian Homborg
parent
3f0e2ef1dc
commit
f73ee30111
@@ -48,8 +48,6 @@ To use this command, pass the option specifications (``OPTION_SPEC``), then a ma
|
||||
|
||||
A simple example::
|
||||
|
||||
::
|
||||
|
||||
argparse --name=my_function 'h/help' 'n/name=' -- $argv
|
||||
or return
|
||||
|
||||
@@ -58,17 +56,13 @@ If ``$argv`` is empty then there is nothing to parse and ``argparse`` returns ze
|
||||
|
||||
The ``or return`` means that the function returns ``argparse``'s status if it failed, so if it goes on ``argparse`` succeeded.
|
||||
|
||||
The ``--`` argument is required. You do not have to include any arguments after the ``--`` but you must include the ``--``. For example, this is acceptable:
|
||||
|
||||
::
|
||||
The ``--`` argument is required. You do not have to include any arguments after the ``--`` but you must include the ``--``. For example, this is acceptable::
|
||||
|
||||
set -l argv
|
||||
argparse 'h/help' 'n/name' -- $argv
|
||||
|
||||
|
||||
But this is not:
|
||||
|
||||
::
|
||||
But this is not::
|
||||
|
||||
set -l argv
|
||||
argparse 'h/help' 'n/name' $argv
|
||||
|
||||
@@ -195,34 +195,23 @@ The following special input functions are available:
|
||||
Examples
|
||||
--------
|
||||
|
||||
::
|
||||
Exit the shell when :kbd:`Control`\ +\ :kbd:`D` is pressed::
|
||||
|
||||
bind \cd 'exit'
|
||||
|
||||
Causes ``fish`` to exit when :kbd:`Control`\ +\ :kbd:`D` is pressed.
|
||||
|
||||
|
||||
|
||||
::
|
||||
Perform a history search when :kbd:`Page Up` is pressed::
|
||||
|
||||
bind -k ppage history-search-backward
|
||||
|
||||
Performs a history search when the :kbd:`Page Up` key is pressed.
|
||||
|
||||
|
||||
|
||||
::
|
||||
Turn on Vi key bindings and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line::
|
||||
|
||||
set -g fish_key_bindings fish_vi_key_bindings
|
||||
bind -M insert \cc kill-whole-line repaint
|
||||
|
||||
Turns on Vi key bindings and rebinds :kbd:`Control`\ +\ :kbd:`C` to clear the input line.
|
||||
Launch ``git diff`` and repaint the commandline afterwards when :kbd:`Control`\ +\ :kbd:`G` is pressed::
|
||||
|
||||
::
|
||||
bind \cg 'git diff; commandline -f repaint'
|
||||
|
||||
Causes :kbd:`Control`\ +\ :kbd:`G` to launch ``git diff`` and repaint the commandline afterwards.
|
||||
|
||||
.. _cmd-bind-termlimits:
|
||||
|
||||
Terminal Limitations
|
||||
|
||||
@@ -133,6 +133,7 @@ To implement an alias, use the ``-w`` or ``--wraps`` option:
|
||||
Now hub inherits all of the completions from git. Note this can also be specified in a function declaration (``function thing -w otherthing``).
|
||||
|
||||
::
|
||||
|
||||
complete -c git
|
||||
|
||||
Show all completions for ``git``.
|
||||
|
||||
@@ -50,20 +50,20 @@ Example
|
||||
::
|
||||
|
||||
# I just installed mycoolthing and need to add it to the path to use it.
|
||||
fish_add_path /opt/mycoolthing/bin
|
||||
> fish_add_path /opt/mycoolthing/bin
|
||||
|
||||
# I want my ~/.local/bin to be checked first.
|
||||
fish_add_path -m ~/.local/bin
|
||||
> fish_add_path -m ~/.local/bin
|
||||
|
||||
# I prefer using a global fish_user_paths
|
||||
fish_add_path -g ~/.local/bin ~/.otherbin /usr/local/sbin
|
||||
> fish_add_path -g ~/.local/bin ~/.otherbin /usr/local/sbin
|
||||
|
||||
# I want to append to the entire $PATH because this directory contains fallbacks
|
||||
fish_add_path -aP /opt/fallback/bin
|
||||
> fish_add_path -aP /opt/fallback/bin
|
||||
|
||||
# I want to add the bin/ directory of my current $PWD (say /home/nemo/)
|
||||
> fish_add_path -v bin/
|
||||
set fish_user_paths /home/nemo/bin /usr/bin /home/nemo/.local/bin
|
||||
|
||||
# I have installed ruby via homebrew
|
||||
fish_add_path /usr/local/opt/ruby/bin
|
||||
> fish_add_path /usr/local/opt/ruby/bin
|
||||
|
||||
@@ -58,9 +58,9 @@ If no option to determine how to split like ``--delimiter``, ``--line`` or ``--t
|
||||
|
||||
With the ``--line`` option, ``read`` reads a line of input from standard input into each provided variable, stopping when each variable has been filled. The line is not tokenized.
|
||||
|
||||
If no variable names are provided, ``read`` enters a special case that simply provides redirection from standard input to standard output, useful for command substitution. For instance, the fish shell command below can be used to read data that should be provided via a command line argument from the console instead of hardcoding it in the command itself, allowing the command to both be reused as-is in various contexts with different input values and preventing possibly sensitive text from being included in the shell history:
|
||||
If no variable names are provided, ``read`` enters a special case that simply provides redirection from standard input to standard output, useful for command substitution. For instance, the fish shell command below can be used to read data that should be provided via a command line argument from the console instead of hardcoding it in the command itself, allowing the command to both be reused as-is in various contexts with different input values and preventing possibly sensitive text from being included in the shell history::
|
||||
|
||||
``mysql -uuser -p(read)``
|
||||
mysql -uuser -p(read)
|
||||
|
||||
When running in this mode, ``read`` does not split the input in any way and text is redirected to standard output without any further processing or manipulation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user