docs: Add labels to all commands

This allows us to use :ref: references, which don't require hardcoding
it as html

[ci skip]
This commit is contained in:
Fabian Homborg 2019-03-31 11:05:09 +02:00
parent c693687812
commit cf9b8fa3fa
90 changed files with 187 additions and 8 deletions

View File

@ -1,3 +1,5 @@
.. _cmd-abbr:
abbr - manage fish abbreviations
================================

View File

@ -1,3 +1,5 @@
.. _cmd-alias:
alias - create a function
=========================

View File

@ -1,3 +1,5 @@
.. _cmd-and:
and - conditionally execute a command
=====================================

View File

@ -1,3 +1,5 @@
.. _cmd-argparse:
argparse - parse options passed to a fish script or function
============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-begin:
begin - start a new block of code
=================================

View File

@ -1,3 +1,5 @@
.. _cmd-bg:
bg - send jobs to background
============================

View File

@ -1,3 +1,5 @@
.. _cmd-bind:
bind - handle fish key bindings
===============================

View File

@ -1,3 +1,5 @@
.. _cmd-block:
block - temporarily block delivery of events
============================================

View File

@ -1,3 +1,5 @@
.. _cmd-break:
break - stop the current inner loop
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-breakpoint:
breakpoint - Launch debug mode
==============================

View File

@ -1,3 +1,5 @@
.. _cmd-builtin:
builtin - run a builtin command
===============================

View File

@ -1,3 +1,5 @@
.. _cmd-case:
case - conditionally execute a block of commands
================================================

View File

@ -1,3 +1,5 @@
.. _cmd-cd:
cd - change directory
=====================

View File

@ -1,3 +1,5 @@
.. _cmd-cdh:
cdh - change to a recently visited directory
============================================

View File

@ -1,3 +1,5 @@
.. _cmd-command:
command - run a program
=======================

View File

@ -1,3 +1,5 @@
.. _cmd-commandline:
commandline - set or get the current command line buffer
========================================================

View File

@ -1,3 +1,5 @@
.. _cmd-complete:
complete - edit command specific tab-completions
================================================

View File

@ -1,3 +1,5 @@
.. _cmd-contains:
contains - test if a word is present in a list
==============================================

View File

@ -1,3 +1,5 @@
.. _cmd-continue:
continue - skip the remainder of the current iteration of the current inner loop
================================================================================

View File

@ -1,3 +1,5 @@
.. _cmd-count:
count - count the number of elements of an array
================================================

View File

@ -1,3 +1,5 @@
.. _cmd-dirh:
dirh - print directory history
==============================

View File

@ -1,3 +1,5 @@
.. _cmd-dirs:
dirs - print directory stack
============================

View File

@ -1,3 +1,5 @@
.. _cmd-disown:
disown - remove a process from the list of jobs
===============================================

View File

@ -1,3 +1,5 @@
.. _cmd-echo:
echo - display a line of text
=============================

View File

@ -1,3 +1,5 @@
.. _cmd-else:
else - execute command if a condition is not met
================================================

View File

@ -1,3 +1,5 @@
.. _cmd-emit:
emit - Emit a generic event
===========================

View File

@ -1,3 +1,5 @@
.. _cmd-end:
end - end a block of commands.
==============================

View File

@ -1,3 +1,5 @@
.. _cmd-eval:
eval - evaluate the specified commands
======================================

View File

@ -1,3 +1,5 @@
.. _cmd-exec:
exec - execute command in current process
=========================================

View File

@ -1,3 +1,5 @@
.. _cmd-exit:
exit - exit the shell
=====================

View File

@ -1,3 +1,5 @@
.. _cmd-false:
false - return an unsuccessful result
=====================================

View File

@ -1,3 +1,5 @@
.. _cmd-fg:
fg - bring job to foreground
============================

View File

@ -1,3 +1,5 @@
.. _cmd-fish:
fish - the friendly interactive shell
=====================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_breakpoint_prompt:
fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
=======================================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_config:
fish_config - start the web-based configuration interface
=========================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_git_prompt:
fish_git_prompt - output git information for use in a prompt
============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_hg_prompt:
fish_hg_prompt - output mercurial information for use in a prompt
=================================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_indent:
fish_indent - indenter and prettifier
=====================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_key_reader:
fish_key_reader - explore what characters keyboard keys send
============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_mode_prompt:
fish_mode_prompt - define the appearance of the mode indicator
==============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_opt:
fish_opt - create an option spec for the argparse command
=========================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_prompt:
fish_prompt - define the appearance of the command line prompt
==============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_right_prompt:
fish_right_prompt - define the appearance of the right-side command line prompt
===============================================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_svn_prompt:
fish_svn_prompt - output svn information for use in a prompt
============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_update_completions:
fish_update_completions - Update completions using manual pages
===============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_vcs_prompt:
fish_vcs_prompt - output vcs information for use in a prompt
============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-fish_vi_mode:
fish_vi_mode - Enable vi mode
=============================

View File

@ -1,3 +1,5 @@
.. _cmd-for:
for - perform a set of commands multiple times.
===============================================

View File

@ -1,3 +1,5 @@
.. _cmd-funced:
funced - edit a function interactively
======================================

View File

@ -1,3 +1,5 @@
.. _cmd-funcsave:
funcsave - save the definition of a function to the user's autoload directory
=============================================================================

View File

@ -1,3 +1,5 @@
.. _cmd-function:
function - create a function
============================

View File

@ -1,3 +1,5 @@
.. _cmd-functions:
functions - print or erase functions
====================================

View File

@ -1,3 +1,5 @@
.. _cmd-help:
help - display fish documentation
=================================

View File

@ -1,3 +1,5 @@
.. _cmd-history:
history - Show and manipulate command history
=============================================

View File

@ -1,3 +1,5 @@
.. _cmd-if:
if - conditionally execute a command
====================================

View File

@ -1,3 +1,5 @@
.. _cmd-isatty:
isatty - test if a file descriptor is a tty.
============================================

View File

@ -1,3 +1,5 @@
.. _cmd-jobs:
jobs - print currently running jobs
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-math:
math - Perform mathematics calculations
=======================================

View File

@ -1,3 +1,5 @@
.. _cmd-nextd:
nextd - move forward through directory history
==============================================

View File

@ -1,3 +1,5 @@
.. _cmd-not:
not - negate the exit status of a job
=====================================

View File

@ -1,3 +1,5 @@
.. _cmd-open:
open - open file in its default application
===========================================

View File

@ -1,3 +1,5 @@
.. _cmd-or:
or - conditionally execute a command
====================================

View File

@ -1,3 +1,5 @@
.. _cmd-popd:
popd - move through directory stack
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-prevd:
prevd - move backward through directory history
===============================================

View File

@ -1,3 +1,5 @@
.. _cmd-printf:
printf - display text according to a format string
==================================================

View File

@ -1,3 +1,5 @@
.. _cmd-prompt_pwd:
prompt_pwd - Print pwd suitable for prompt
==========================================

View File

@ -1,3 +1,5 @@
.. _cmd-psub:
psub - perform process substitution
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-pushd:
pushd - push directory to directory stack
=========================================

View File

@ -1,3 +1,5 @@
.. _cmd-pwd:
pwd - output the current working directory
==========================================

View File

@ -1,3 +1,5 @@
.. _cmd-random:
random - generate random number
===============================

View File

@ -1,3 +1,5 @@
.. _cmd-read:
read - read line of input into variables
========================================

View File

@ -1,3 +1,5 @@
.. _cmd-realpath:
realpath - Convert a path to an absolute path without symlinks
==============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-return:
return - stop the current inner function
========================================

View File

@ -1,3 +1,5 @@
.. _cmd-set:
set - display and change shell variables.
=========================================

View File

@ -1,3 +1,5 @@
.. _cmd-set_color:
set_color - set the terminal color
==================================

View File

@ -1,3 +1,5 @@
.. _cmd-source:
source - evaluate contents of file.
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-status:
status - query fish runtime information
=======================================

View File

@ -1,3 +1,5 @@
.. _cmd-string:
string - manipulate strings
===========================

View File

@ -1,3 +1,5 @@
.. _cmd-suspend:
suspend - suspend the current shell
===================================

View File

@ -1,3 +1,5 @@
.. _cmd-switch:
switch - conditionally execute a block of commands
==================================================

View File

@ -1,3 +1,5 @@
.. _cmd-test:
test - perform tests on files and text
======================================

View File

@ -1,3 +1,5 @@
.. _cmd-trap:
trap - perform an action when the shell receives a signal
=========================================================

View File

@ -1,3 +1,5 @@
.. _cmd-true:
true - return a successful result
=================================

View File

@ -1,3 +1,5 @@
.. _cmd-type:
type - indicate how a command would be interpreted
==================================================

View File

@ -1,3 +1,5 @@
.. _cmd-ulimit:
ulimit - set or get resource usage limits
=========================================

View File

@ -1,3 +1,5 @@
.. _cmd-umask:
umask - set or get the file creation mode mask
==============================================

View File

@ -1,3 +1,5 @@
.. _cmd-vared:
vared - interactively edit the value of an environment variable
===============================================================

View File

@ -1,3 +1,5 @@
.. _cmd-wait:
wait - wait for jobs to complete
================================

View File

@ -1,3 +1,5 @@
.. _cmd-while:
while - perform a command multiple times
========================================

View File

@ -144,14 +144,15 @@ latex_documents = [
# -- Options for manual page output ------------------------------------------
def get_command_description(path):
""" Return the description for a command, by parsing its first line """
def get_command_description(path, name):
""" Return the description for a command, by parsing its synopsis line """
with open(path) as fd:
title = fd.readline()
if ' - ' not in title:
raise SphinxWarning('No description in file %s' % os.path.basename(path))
_, desc = title.split(' - ', 1)
return desc.strip()
for line in fd:
if line.startswith(name + " - "):
_, desc = line.split(' - ', 1)
return desc.strip()
raise SphinxWarning('No description in file %s' % os.path.basename(path))
# One entry per manual page. List of tuples
@ -163,7 +164,7 @@ man_pages = [
for path in sorted(glob.glob('cmds/*')):
docname = strip_ext(path)
cmd = os.path.basename(docname)
man_pages.append((docname, cmd, get_command_description(path), '', 1))
man_pages.append((docname, cmd, get_command_description(path, cmd), '', 1))
# -- Options for Texinfo output ----------------------------------------------