From c97cea1310844178878d66490709c396f557ea8c Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 30 Jun 2024 11:11:32 -0700 Subject: [PATCH] Fix some manpage issues Closes #312, #311 --- man-page/py.1 | 103 +++++++++++++++++------------------------------ man-page/py.1.md | 6 +-- 2 files changed, 41 insertions(+), 68 deletions(-) diff --git a/man-page/py.1 b/man-page/py.1 index 97a28e2..2b6b877 100644 --- a/man-page/py.1 +++ b/man-page/py.1 @@ -1,53 +1,47 @@ -.\" Automatically generated by Pandoc 2.2.1 +.\" Automatically generated by Pandoc 3.2.1 .\" -.TH "PY" "1" "2022-11-04" "Python Launcher 1.0.0" "Python Launcher" -.hy +.TH "PY" "1" "2024-06-30" "Python Launcher 1.0.1" "Python Launcher" .SH NAME -.PP py \- launch a Python interpreter .SH SYNOPSIS -.PP -\f[B]py\f[] [\f[B]\-[X]/[X.Y]\f[]] \&... +\f[B]py\f[R] [\f[B]\-[X]/[X.Y]\f[R]] \&... .SH DESCRIPTION -.PP -\f[B]py\f[] launches the most appropriate Python interpreter it can +\f[B]py\f[R] launches the most appropriate Python interpreter it can find. -It is meant to act as a shorthand for launching \f[B]python\f[] without -having to think about \f[I]which\f[] Python interpreter is the most +It is meant to act as a shorthand for launching \f[B]python\f[R] without +having to think about \f[I]which\f[R] Python interpreter is the most desired. The Python Launcher is not meant to substitute all ways of launching Python, e.g.\ if a specific Python interpreter is desired then it is assumed it will be directly executed. .SH SPECIFYING A PYTHON VERSION -.PP -If a command\-line option is provided in the form of \f[B]\-X\f[] or -\f[B]\-X.Y\f[] where \f[I]X\f[] and \f[I]Y\f[] are integers, then that -version of Python will be launched (if available). -For instance, providing \f[B]\-3\f[] will launch the newest version of -Python 3 while \f[B]\-3.6\f[] will try to launch Python 3.6. +If a command\-line option is provided in the form of \f[B]\-X\f[R] or +\f[B]\-X.Y\f[R] where \f[I]X\f[R] and \f[I]Y\f[R] are integers, then +that version of Python will be launched (if available). +For instance, providing \f[B]\-3\f[R] will launch the newest version of +Python 3 while \f[B]\-3.6\f[R] will try to launch Python 3.6. .SH SEARCHING FOR PYTHON INTERPRETERS -.PP When no command\-line arguments are provided to the launcher, what is deemed the most \[lq]appropriate\[rq] interpreter is searched for as follows: .IP "1." 3 An activated virtual environment (launched immediately if available) .IP "2." 3 -A \f[B].venv\f[] directory in the current working directory or any +A \f[B].venv\f[R] directory in the current working directory or any parent directory containing a virtual environment (launched immediately if available) .IP "3." 3 If a file path is provided as the first argument, look for a shebang -line containing \f[B]/usr/bin/python\f[], -\f[B]/usr/local/bin/python\f[], \f[B]/usr/bin/env python\f[] or -\f[B]python\f[] and any version specification in the executable name is -treated as a version specifier (like with \f[B]\-X\f[]/\f[B]\-X.Y\f[] +line containing \f[B]/usr/bin/python\f[R], +\f[B]/usr/local/bin/python\f[R], \f[B]/usr/bin/env python\f[R] or +\f[B]python\f[R] and any version specification in the executable name is +treated as a version specifier (like with \f[B]\-X\f[R]/\f[B]\-X.Y\f[R] command\-line options) .IP "4." 3 Check for any appropriate environment variable (see -\f[B]ENVIRONMENT\f[]) +\f[B]ENVIRONMENT\f[R]) .IP "5." 3 -Search \f[B]PATH\f[] for all \f[B]pythonX.Y\f[] executables +Search \f[B]PATH\f[R] for all \f[B]pythonX.Y\f[R] executables .IP "6." 3 Launch the newest version of Python (while matching any version restrictions previously specified) @@ -56,70 +50,49 @@ All unrecognized command\-line arguments are passed on to the launched Python interpreter. .SH OPTIONS .TP -.B \f[B]\-h\f[]/\f[B]\[en]help\f[] +\f[B]\-h\f[R], \f[B]\-\-help\f[R] Print a help message and exit; must be specified on its own. -.RS -.RE .TP -.B \f[B]\[en]list\f[] -List all known interpreters (except activated virtual environment); must -be specified on its own. -.RS -.RE +\f[B]\-\-list\f[R] +List all known interpreters (except virtual environments); must be +specified on its own. .TP -.B \f[B]\-[X]\f[] -Launch the latest Python \f[I]X\f[] version (e.g. -\f[B]\-3\f[] for the latest Python 3). -See \f[B]ENVIRONMENT\f[] for details on the \f[B]PY_VERSION[X]\f[] +\f[B]\-[X]\f[R] +Launch the latest Python \f[I]X\f[R] version (e.g.\ \f[B]\-3\f[R] for +the latest Python 3). +See \f[B]ENVIRONMENT\f[R] for details on the \f[B]PY_VERSION[X]\f[R] environment variable. -.RS -.RE .TP -.B \f[B]\-[X.Y]\f[] -Launch the specified Python version (e.g. -\f[B]\-3.6\f[] for Python 3.6). -.RS -.RE +\f[B]\-[X.Y]\f[R] +Launch the specified Python version (e.g.\ \f[B]\-3.6\f[R] for Python +3.6). .SH ENVIRONMENT .TP -.B \f[B]PY_PYTHON\f[] +\f[B]PY_PYTHON\f[R] Specify the version of Python to search for when no Python version is -explicitly requested (must be formatted as `X.Y'; e.g. -\f[B]3.6\f[] to use Python 3.6 by default). -.RS -.RE +explicitly requested (must be formatted as `X.Y'; e.g.\ \f[B]3.6\f[R] to +use Python 3.6 by default). .TP -.B \f[B]PY_PYTHON[X]\f[] +\f[B]PY_PYTHON[X]\f[R] Specify the version of Python to search for when only a major version is -specified (must be formatted as `X.Y'; e.g.\ set \f[B]PY_PYTHON3\f[] to -\f[B]3.6\f[] to cause \f[B]\-3\f[] to use Python 3.6). -.RS -.RE +specified (must be formatted as `X.Y'; e.g.\ set \f[B]PY_PYTHON3\f[R] to +\f[B]3.6\f[R] to cause \f[B]\-3\f[R] to use Python 3.6). .TP -.B \f[B]PYLAUNCH_DEBUG\f[] +\f[B]PYLAUNCH_DEBUG\f[R] Log details to stderr about how the Launcher is operating. -.RS -.RE .TP -.B \f[B]VIRTUAL_ENV\f[] +\f[B]VIRTUAL_ENV\f[R] Path to a directory containing virtual environment to use when no Python version is explicitly requested; typically set by activating a virtual environment. -.RS -.RE .TP -.B \f[B]PATH\f[] +\f[B]PATH\f[R] Used to search for Python interpreters. -.RS -.RE .SH AUTHORS -.PP Copyright © 2018 Brett Cannon. .PP Licensed under MIT. .SH HOMEPAGE -.PP https://github.com/brettcannon/python\-launcher/ .SH SEE ALSO -.PP python(1), python3(1). diff --git a/man-page/py.1.md b/man-page/py.1.md index f9b5323..2727c1e 100644 --- a/man-page/py.1.md +++ b/man-page/py.1.md @@ -53,11 +53,11 @@ interpreter. # OPTIONS -**-h**/**--help** +**-h**, **\--help** : Print a help message and exit; must be specified on its own. -**--list** -: List all known interpreters (except activated virtual environment); +**\--list** +: List all known interpreters (except virtual environments); must be specified on its own. **-[X]**