summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-01-19 08:03:03 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-01-19 08:03:03 -0500
commitcd88e673cd34a6fb2a899a144b402c5659dcf24b (patch)
treef0eaa8eb777693f8996d0fdf447d30fc92fe39cc /doc
parent105aea7eba5d1f062e41a1f1052823c89c1d0908 (diff)
downloadpython-coveragepy-git-cd88e673cd34a6fb2a899a144b402c5659dcf24b.tar.gz
Some doc clarification from George Paci
Diffstat (limited to 'doc')
-rw-r--r--doc/cmd.rst12
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst
index 302eb979..a9c00dcc 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -12,6 +12,7 @@ Coverage command line usage
:history: 20100223T200600, changes for 3.3
:history: 20100725T211700, updated for 3.4
:history: 20110827T212500, updated for 3.5.1, combining aliases
+:history: 20120119T075600, Added some clarification from George Paci
.. highlight:: console
@@ -69,14 +70,21 @@ Your program runs just as if it had been invoked with the Python command line.
Arguments after your file name are passed to your program as usual in
``sys.argv``. Rather than providing a filename, you can use the ``-m`` switch
and specify an importable module name instead, just as you can with the
-Python ``-m`` switch.
+Python ``-m`` switch::
+
+ $ coverage run -m packagename.modulename arg1 arg2
+ blah blah ..your program's output.. blah blah
If you want :ref:`branch coverage <branch>` measurement, use the ``--branch``
flag. Otherwise only statement coverage is measured.
You can specify the code to measure with the ``--source``, ``--include``, and
``--omit`` switches. See :ref:`Specifying source files <source_execution>` for
-more details.
+details of their interpretation. Remember to put options for run after "run",
+but before the program invocation::
+
+ $ coverage run --source=dir1,dir2 my_program.py arg1 arg2
+ $ coverage run --source=dir1,dir2 -m packagename.modulename arg1 arg2
By default, coverage does not measure code installed with the Python
interpreter, for example, the standard library. If you want to measure that