fish-shell/sphinx_doc_src/cmds/string-length.rst
Johannes Altmanninger 08eac28bd8 Add individual documentation pages for string's subcommands
This adds string-x.rst for each subcommand x of string. The main page
(string.rst) is not changed, except that examples are shown directly after
each subcommand.  The subcommand sections in string.rst are created by
textual inclusion of parts of the string-x.rst files.

Subcommand man pages can be viewed with either of:

```
man string collect
man string-collect
string collect <press F1 or Alt-h>
string collect -h
```

While `string -h ...` still prints the full help.

Closes #5968
2019-11-07 09:54:25 +01:00

40 lines
605 B
ReStructuredText

string-length - print string lengths
====================================
Synopsis
--------
.. BEGIN SYNOPSIS
::
string length [(-q | --quiet)] [STRING...]
.. END SYNOPSIS
Description
-----------
.. BEGIN DESCRIPTION
``string length`` reports the length of each string argument in characters. Exit status: 0 if at least one non-empty STRING was given, or 1 otherwise.
.. END DESCRIPTION
Examples
--------
.. BEGIN EXAMPLES
::
>_ string length 'hello, world'
12
>_ set str foo
>_ string length -q $str; echo $status
0
# Equivalent to test -n $str
.. END EXAMPLES