mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
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:
parent
c693687812
commit
cf9b8fa3fa
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-abbr:
|
||||
|
||||
abbr - manage fish abbreviations
|
||||
================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-alias:
|
||||
|
||||
alias - create a function
|
||||
=========================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-and:
|
||||
|
||||
and - conditionally execute a command
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-argparse:
|
||||
|
||||
argparse - parse options passed to a fish script or function
|
||||
============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-begin:
|
||||
|
||||
begin - start a new block of code
|
||||
=================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-bg:
|
||||
|
||||
bg - send jobs to background
|
||||
============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-bind:
|
||||
|
||||
bind - handle fish key bindings
|
||||
===============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-block:
|
||||
|
||||
block - temporarily block delivery of events
|
||||
============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-break:
|
||||
|
||||
break - stop the current inner loop
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-breakpoint:
|
||||
|
||||
breakpoint - Launch debug mode
|
||||
==============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-builtin:
|
||||
|
||||
builtin - run a builtin command
|
||||
===============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-case:
|
||||
|
||||
case - conditionally execute a block of commands
|
||||
================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-cd:
|
||||
|
||||
cd - change directory
|
||||
=====================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-cdh:
|
||||
|
||||
cdh - change to a recently visited directory
|
||||
============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-command:
|
||||
|
||||
command - run a program
|
||||
=======================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-commandline:
|
||||
|
||||
commandline - set or get the current command line buffer
|
||||
========================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-complete:
|
||||
|
||||
complete - edit command specific tab-completions
|
||||
================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-contains:
|
||||
|
||||
contains - test if a word is present in a list
|
||||
==============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-continue:
|
||||
|
||||
continue - skip the remainder of the current iteration of the current inner loop
|
||||
================================================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-count:
|
||||
|
||||
count - count the number of elements of an array
|
||||
================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-dirh:
|
||||
|
||||
dirh - print directory history
|
||||
==============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-dirs:
|
||||
|
||||
dirs - print directory stack
|
||||
============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-disown:
|
||||
|
||||
disown - remove a process from the list of jobs
|
||||
===============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-echo:
|
||||
|
||||
echo - display a line of text
|
||||
=============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-else:
|
||||
|
||||
else - execute command if a condition is not met
|
||||
================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-emit:
|
||||
|
||||
emit - Emit a generic event
|
||||
===========================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-end:
|
||||
|
||||
end - end a block of commands.
|
||||
==============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-eval:
|
||||
|
||||
eval - evaluate the specified commands
|
||||
======================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-exec:
|
||||
|
||||
exec - execute command in current process
|
||||
=========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-exit:
|
||||
|
||||
exit - exit the shell
|
||||
=====================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-false:
|
||||
|
||||
false - return an unsuccessful result
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fg:
|
||||
|
||||
fg - bring job to foreground
|
||||
============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish:
|
||||
|
||||
fish - the friendly interactive shell
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_breakpoint_prompt:
|
||||
|
||||
fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
|
||||
=======================================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_config:
|
||||
|
||||
fish_config - start the web-based configuration interface
|
||||
=========================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_git_prompt:
|
||||
|
||||
fish_git_prompt - output git information for use in a prompt
|
||||
============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_hg_prompt:
|
||||
|
||||
fish_hg_prompt - output mercurial information for use in a prompt
|
||||
=================================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_indent:
|
||||
|
||||
fish_indent - indenter and prettifier
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_key_reader:
|
||||
|
||||
fish_key_reader - explore what characters keyboard keys send
|
||||
============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_mode_prompt:
|
||||
|
||||
fish_mode_prompt - define the appearance of the mode indicator
|
||||
==============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_opt:
|
||||
|
||||
fish_opt - create an option spec for the argparse command
|
||||
=========================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_prompt:
|
||||
|
||||
fish_prompt - define the appearance of the command line prompt
|
||||
==============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_right_prompt:
|
||||
|
||||
fish_right_prompt - define the appearance of the right-side command line prompt
|
||||
===============================================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_svn_prompt:
|
||||
|
||||
fish_svn_prompt - output svn information for use in a prompt
|
||||
============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_update_completions:
|
||||
|
||||
fish_update_completions - Update completions using manual pages
|
||||
===============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_vcs_prompt:
|
||||
|
||||
fish_vcs_prompt - output vcs information for use in a prompt
|
||||
============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-fish_vi_mode:
|
||||
|
||||
fish_vi_mode - Enable vi mode
|
||||
=============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-for:
|
||||
|
||||
for - perform a set of commands multiple times.
|
||||
===============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-funced:
|
||||
|
||||
funced - edit a function interactively
|
||||
======================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-funcsave:
|
||||
|
||||
funcsave - save the definition of a function to the user's autoload directory
|
||||
=============================================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-function:
|
||||
|
||||
function - create a function
|
||||
============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-functions:
|
||||
|
||||
functions - print or erase functions
|
||||
====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-help:
|
||||
|
||||
help - display fish documentation
|
||||
=================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-history:
|
||||
|
||||
history - Show and manipulate command history
|
||||
=============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-if:
|
||||
|
||||
if - conditionally execute a command
|
||||
====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-isatty:
|
||||
|
||||
isatty - test if a file descriptor is a tty.
|
||||
============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-jobs:
|
||||
|
||||
jobs - print currently running jobs
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-math:
|
||||
|
||||
math - Perform mathematics calculations
|
||||
=======================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-nextd:
|
||||
|
||||
nextd - move forward through directory history
|
||||
==============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-not:
|
||||
|
||||
not - negate the exit status of a job
|
||||
=====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-open:
|
||||
|
||||
open - open file in its default application
|
||||
===========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-or:
|
||||
|
||||
or - conditionally execute a command
|
||||
====================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-popd:
|
||||
|
||||
popd - move through directory stack
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-prevd:
|
||||
|
||||
prevd - move backward through directory history
|
||||
===============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-printf:
|
||||
|
||||
printf - display text according to a format string
|
||||
==================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-prompt_pwd:
|
||||
|
||||
prompt_pwd - Print pwd suitable for prompt
|
||||
==========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-psub:
|
||||
|
||||
psub - perform process substitution
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-pushd:
|
||||
|
||||
pushd - push directory to directory stack
|
||||
=========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-pwd:
|
||||
|
||||
pwd - output the current working directory
|
||||
==========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-random:
|
||||
|
||||
random - generate random number
|
||||
===============================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-read:
|
||||
|
||||
read - read line of input into variables
|
||||
========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-realpath:
|
||||
|
||||
realpath - Convert a path to an absolute path without symlinks
|
||||
==============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-return:
|
||||
|
||||
return - stop the current inner function
|
||||
========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-set:
|
||||
|
||||
set - display and change shell variables.
|
||||
=========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-set_color:
|
||||
|
||||
set_color - set the terminal color
|
||||
==================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-source:
|
||||
|
||||
source - evaluate contents of file.
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-status:
|
||||
|
||||
status - query fish runtime information
|
||||
=======================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-string:
|
||||
|
||||
string - manipulate strings
|
||||
===========================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-suspend:
|
||||
|
||||
suspend - suspend the current shell
|
||||
===================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-switch:
|
||||
|
||||
switch - conditionally execute a block of commands
|
||||
==================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-test:
|
||||
|
||||
test - perform tests on files and text
|
||||
======================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-trap:
|
||||
|
||||
trap - perform an action when the shell receives a signal
|
||||
=========================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-true:
|
||||
|
||||
true - return a successful result
|
||||
=================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-type:
|
||||
|
||||
type - indicate how a command would be interpreted
|
||||
==================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-ulimit:
|
||||
|
||||
ulimit - set or get resource usage limits
|
||||
=========================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-umask:
|
||||
|
||||
umask - set or get the file creation mode mask
|
||||
==============================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-vared:
|
||||
|
||||
vared - interactively edit the value of an environment variable
|
||||
===============================================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-wait:
|
||||
|
||||
wait - wait for jobs to complete
|
||||
================================
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _cmd-while:
|
||||
|
||||
while - perform a command multiple times
|
||||
========================================
|
||||
|
||||
|
|
|
@ -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 ----------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user