mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 06:24:01 +00:00
97db9d5c38
This corrects what looks like wrong alignment of some synopsis lines. (I think the alignment is not a bad idea but it makes us do more manual work, maybe we can automate that in future. We still need to figure out how to translate it to HTML.) "man -l build/user_doc/man/man1/history.1" before: string match [-a | --all] [-e | --entire] [-i | --ignore-case] [-r | --regex] [-n | --index] [-q | --quiet] [-v | --invert] PATTERN [STRING…] and after: string match [-a | --all] [-e | --entire] [-i | --ignore-case] [-r | --regex] [-n | --index] [-q | --quiet] [-v | --invert] PATTERN [STRING…] Also make the lines align the same way in the RST source by carefully choosing the position of the backslash. I'm not sure why we used two backslashes per line. Use only one; this gives us no choice of where to put it so both source and man page output are aligned. Change tabs to spaces to make the alignment in the source work.
51 lines
1.3 KiB
ReStructuredText
51 lines
1.3 KiB
ReStructuredText
string-sub - extract substrings
|
|
===============================
|
|
|
|
Synopsis
|
|
--------
|
|
|
|
.. BEGIN SYNOPSIS
|
|
|
|
``string`` sub [(**-s** | **--start**) *START*] [(**-l** | **--length**) *LENGTH*]
|
|
\ [**-q** | **--quiet**] [*STRING* ...]
|
|
|
|
.. END SYNOPSIS
|
|
|
|
Description
|
|
-----------
|
|
|
|
.. BEGIN DESCRIPTION
|
|
|
|
``string sub`` prints a substring of each string argument. The start/end of the substring can be specified with ``-s``/``-e`` or ``--start``/``--end`` followed by a 1-based index value. Positive index values are relative to the start of the string and negative index values are relative to the end of the string. The default start value is 1. The length of the substring can be specified with ``-l`` or ``--length``. If the length or end is not specified, the substring continues to the end of each STRING. Exit status: 0 if at least one substring operation was performed, 1 otherwise. ``--length`` is mutually exclusive with ``--end``.
|
|
|
|
.. END DESCRIPTION
|
|
|
|
Examples
|
|
--------
|
|
|
|
.. BEGIN EXAMPLES
|
|
|
|
::
|
|
|
|
>_ string sub --length 2 abcde
|
|
ab
|
|
|
|
>_ string sub -s 2 -l 2 abcde
|
|
bc
|
|
|
|
>_ string sub --start=-2 abcde
|
|
de
|
|
|
|
>_ string sub --end=3 abcde
|
|
abc
|
|
|
|
>_ string sub -e -1 abcde
|
|
abcd
|
|
|
|
>_ string sub -s 2 -e -1 abcde
|
|
bcd
|
|
|
|
>_ string sub -s -3 -e -2 abcde
|
|
c
|
|
|
|
.. END EXAMPLES
|