Skip to content
Myr

Fix issue #725

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

authored by Daw-Ran Liou · committed by Daw-Ran Liou · parent f27a8df · Browse files · 2 files+24 added−0 removed
This commit

State

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

Diff stats

2 files+24 added−0 removed

  • other:+24 added−0 removed

2 files+24 added−0 removed

modified:docs/options.rst+22 added
8 unmodified lines
9decorator. Since options can come in various different versions, there10are a ton of parameters to configure their behavior. Options in click are11distinct from :ref:`positional arguments <arguments>`.1213Name Your Options14-----------------1516The naming rules can be found in :ref:`parameter_names`. In short, you17can refer the option **implicitly** by the longest dash-prefixed argument:1819.. click:example::2021 @click.command()22 @click.option('-s', '--string-to-echo')23 def echo(string_to_echo):24 click.echo(string_to_echo)2526Or, **explicitly**, by giving one non-dash-prefixed argument:2728.. click:example::2930 @click.command()31 @click.option('-s', '--string-to-echo', 'string')32 def echo(string):33 click.echo(string)3435Basic Value Options36-------------------3738The most basic option is a value option. These options accept one
749 unmodified lines
modified:docs/parameters.rst+2 added
72 unmodified lines
73Custom parameter types can be implemented by subclassing74:class:`click.ParamType`. For simple cases, passing a Python function that75fails with a `ValueError` is also supported, though discouraged.7677.. _parameter_names:7879Parameter Names80---------------8182Parameters (both options and arguments) accept a number of positional arguments
51 unmodified lines