Skip to content

Commit

Permalink
Documentation fixes and updates
Browse files Browse the repository at this point in the history
- Fixed optparse links
- Added note about plans to replace optparse with argparse
- Added subsection about the functions which control argument parsing for commands with flags
  • Loading branch information
tleonhardt committed Feb 12, 2017
1 parent c854913 commit 2b049c4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/unfreefeatures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ terminators. A blank line
is *always* considered a command terminator
(cannot be overridden).


Parsed statements
=================

Expand Down Expand Up @@ -77,6 +78,7 @@ to *use* ``arg.parsed``.)

.. _pyparsing: http://pyparsing.wikispaces.com/


Environment parameters
======================

Expand Down Expand Up @@ -189,9 +191,25 @@ the option's online help.
-h, --help show this help message and exit
-t, --train by train

.. _optparse:
Controlling how arguments are parsed for commands with flags
------------------------------------------------------------
There are three functions which can globally effect how arguments are parsed for commands with flags:

.. autofunction:: cmd2.set_posix_shlex

.. autofunction:: cmd2.set_strip_quotes

.. autofunction:: cmd2.set_use_arg_list

.. note::

Since optparse_ has been deprecated since Python 3.2, the ``cmd2`` developers plan to replace optparse_ with
argparse_ in the next version of ``cmd2``. We will endeavor to keep the API as identical as possible when this
change occurs.

.. _optparse: https://docs.python.org/3/library/optparse.html
.. _argparse: https://docs.python.org/3/library/argparse.html

.. _outputters:

poutput, pfeedback, perror
==========================
Expand All @@ -204,6 +222,7 @@ instead. These methods have these advantages:
- More concise
- ``.pfeedback()`` destination is controlled by :ref:`quiet` parameter.


color
=====

Expand All @@ -213,6 +232,7 @@ Text output can be colored by wrapping it in the ``colorize`` method.

.. _quiet:


quiet
=====

Expand All @@ -221,6 +241,7 @@ useful for non-essential feedback that the user may not always want
to read. ``quiet`` is only relevant if
``app.pfeedback`` is sometimes used.


select
======

Expand Down

0 comments on commit 2b049c4

Please sign in to comment.