summaryrefslogtreecommitdiff
path: root/docs/options.rst
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-05-31 19:19:45 +0600
committerArmin Ronacher <armin.ronacher@active-4.com>2014-05-31 19:19:45 +0600
commit133c4173934e99903a4c075e048e742bd21e343e (patch)
treee4bb4314844c87b2fce1d5181ba8a98c2f9abd3d /docs/options.rst
parentd428e693d2c34d71df6ce03528dfa119b582ff23 (diff)
downloadclick-133c4173934e99903a4c075e048e742bd21e343e.tar.gz
Improved handling of dos/windows arguments greatly.
Diffstat (limited to 'docs/options.rst')
-rw-r--r--docs/options.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/options.rst b/docs/options.rst
index 01db3cf..eb74550 100644
--- a/docs/options.rst
+++ b/docs/options.rst
@@ -148,6 +148,20 @@ And on the command line:
invoke(info, args=['--shout'])
+Note that if a slash is contained in your option already (for instance if
+you use windows style parameters where ``/`` is the prefix character you
+can alternatively split the parameters through ``;`` instead):
+
+.. click:example::
+
+ @click.command()
+ @click.option('/debug;/no-debug')
+ def log(debug):
+ click.echo('debug=%s' % debug)
+
+ if __name__ == '__main__':
+ log()
+
Feature Switches
----------------
@@ -500,6 +514,19 @@ And from the command line:
invoke(chmod, args=['+w'])
invoke(chmod, args=['-w'])
+Note that if you are using ``/`` as prefix character and you want to use a
+boolean flag you need to separate it with ``;`` instead of ``/``:
+
+.. click:example::
+
+ @click.command()
+ @click.option('/debug;/no-debug')
+ def log(debug):
+ click.echo('debug=%s' % debug)
+
+ if __name__ == '__main__':
+ log()
+
.. _ranges:
Range Options