Skip to content
Myr

Standardized capitalization of Unix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Yap · committed by Kevin Yap · parent 9b2648a · Browse files · 5 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+6 added−6 removed

  • other:+6 added−6 removed

5 files+6 added−6 removed

modified:click/types.py+1 added-1 removed
26 unmodified lines
27 #: if a list of this type is expected and the value is pulled from a28 #: string environment variable, this is what splits it up. `None`29 #: means any whitespace. For all parameters the general rule is that30 #: whitespace splits them up. The exception are paths and files which31 #: are split by ``os.path.pathsep`` by default (":" on unix and ";" on31 #: are split by ``os.path.pathsep`` by default (":" on Unix and ";" on32 #: Windows).33 envvar_list_splitter = None3435 def __call__(self, value, param=None, ctx=None):
396 unmodified lines
modified:docs/options.rst+1 added-1 removed
462 unmodified lines
463464The default implementation for all types is to split on whitespace. The465exceptions to this rule are the :class:`File` and :class:`Path` types466which both split according to the operating system's path splitting rules.467On UNIX systems like Linux and OS X, the splitting happens for those on467On Unix systems like Linux and OS X, the splitting happens for those on468every colon (``:``), and for Windows, on every semicolon (``;``).469470Example usage:471
137 unmodified lines
modified:docs/setuptools.rst+2 added-2 removed
2 unmodified lines
3Usage with Setuptools4=====================56When writing command line utilities, it's recommended to write them as7modules that are distributed with setuptools instead of using UNIX7modules that are distributed with setuptools instead of using Unix8shebangs. There are many reasons for this.910The first one is that setuptools automatically generates executable11wrappers for Windows so your command line utilities work on Windows too.1213The second reason is that setuptools scripts work with virtualenv on UNIX13The second reason is that setuptools scripts work with virtualenv on Unix14without the virtualenv having to be activated. This is a very useful15concept which allows you to bundle your scripts with all requirements into16a virtualenv.17
64 unmodified lines
modified:docs/why.rst+1 added-1 removed
6 unmodified lines
7This question is easy to answer: because there is not a single command8line utility for Python out there which ticks the following boxes:910* is lazily composable without restrictions11* fully follows the UNIX command line conventions11* fully follows the Unix command line conventions12* supports loading values from environment variables out of the box13* supports for prompting of custom values14* is fully nestable and composable15* works the same in Python 2 and 3
137 unmodified lines
modified:examples/inout/inout.py+1 added-1 removed
3 unmodified lines
4@click.command()5@click.argument('input', type=click.File('rb'), nargs=-1)6@click.argument('output', type=click.File('wb'))7def cli(input, output):8 """This script works similar to the unix `cat` command but it writes8 """This script works similar to the Unix `cat` command but it writes9 into a specific file (which could be the standard output as denoted by10 the ``-`` sign).1112 \b
18 unmodified lines