Skip to content

Commit

Permalink
Docs: Fix commands given in the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Dec 13, 2024
1 parent 7047536 commit 2ca9c76
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ The usual command is the following:

.. code::
synthesis_workflow <workflow>
synthesis-workflow <workflow>
You can get help and complete parameter description with the following commands:

.. code::
synthesis_workflow --help
synthesis_workflow <workflow> --help
synthesis-workflow --help
synthesis-workflow <workflow> --help
You can also run a complete ``luigi`` command in order to fine-control task parameters:

Expand All @@ -46,7 +46,7 @@ You can also run a complete ``luigi`` command in order to fine-control task para
.. note::

The ``synthesis_workflow`` command (or the complete ``luigi`` command) must be
The ``synthesis-workflow`` command (or the complete ``luigi`` command) must be
executed from a directory containing a ``luigi.cfg`` file.
A simple example of such file is given in the ``examples`` directory.

Expand All @@ -57,13 +57,13 @@ The usual command is the following:

.. code::
morph_validation -t <path to reference data> -r <path to test data> -o <output path> -c <YAML config file> --bio-compare
morph-validation -t <path to reference data> -r <path to test data> -o <output path> -c <YAML config file> --bio-compare
You can get help and complete parameter description with the following command:

.. code::
morph_validation --help
morph-validation --help
Funding & Acknowledgment
~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions src/morphval/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

import pkg_resources

import morphval
from morphval import config
from morphval.validation_main import Validation


def get_parser():
"""Return the argument parser."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s, version {morphval.__version__}",
)
parser.add_argument(
"-t", "--test-dir", required=True, help="full path to directory with test data"
)
Expand Down
12 changes: 10 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ def test_dependency_graph(self, vacuum_working_directory):
assert (root_dir / "dependency_graph.png").exists()


def test_entry_point(script_runner):
"""Test the entry point."""
def test_entry_point_synthesis_workflow(script_runner):
"""Test the entry point of synthesis-workflow."""
ret = script_runner.run("synthesis-workflow", "--version")
assert ret.success
assert ret.stdout.startswith("synthesis-workflow, version ")
assert ret.stderr == ""


def test_entry_point_morph_validation(script_runner):
"""Test the entry point of MorphVal."""
ret = script_runner.run("morph-validation", "--version")
assert ret.success
assert ret.stdout.startswith("morph-validation, version ")
assert ret.stderr == ""

0 comments on commit 2ca9c76

Please sign in to comment.