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 ----------------------------------------------