diff --git a/src/chacha_cicd_helper/__main__.py b/src/chacha_cicd_helper/__main__.py index b111833..d1dc30e 100644 --- a/src/chacha_cicd_helper/__main__.py +++ b/src/chacha_cicd_helper/__main__.py @@ -44,27 +44,24 @@ class chacha_cicd_helper_args(Tap): def configure(self) -> None: """specific arguments initializer""" - self.add_argument("-pp", "--project-path", dest="projectpath", help="path of the python project to process", default=os.getcwd()) + self.add_argument("-pp", "--projectpath", help="path of the python project to process", default=os.getcwd()) - self.add_argument("-tc", "--type-check", dest="typecheck", action="store_true", help="enable static typing check") + self.add_argument("-tc", "--typecheck", action="store_true", help="enable static typing check") - self.add_argument("-ut", "--unit-test", dest="unittest", action="store_true", help="enable unit-test") + self.add_argument("-ut", "--unittest", action="store_true", help="enable unit-test") self.add_argument( "-cc", - "--coverage-check", - dest="coveragecheck", + "--coveragecheck", action="store_true", help="enable unit-test coverage check (requires unit-test)", ) - self.add_argument("-qc", "--quality-check", dest="qualitycheck", action="store_true", help="enable code quality check") + self.add_argument("-qc", "--qualitycheck", action="store_true", help="enable code quality check") - self.add_argument("-dg", "--doc-gen", dest="docgen", action="store_true", help="enable documentation generation using MkDoc") - self.add_argument( - "-pdf", "--doc-gen-pdf", dest="docgenpdf", action="store_true", help="enable pdf documentation export (requires doc-gen)" - ) + self.add_argument("-dg", "--docgen", action="store_true", help="enable documentation generation using MkDoc") + self.add_argument("-pdf", "--docgenpdf", action="store_true", help="enable pdf documentation export (requires doc-gen)") - self.add_argument("-cpc", "--complexity-check", dest="complexitycheck", action="store_true", help="enable complexity check") + self.add_argument("-cpc", "--complexitycheck", action="store_true", help="enable complexity check") def fct_main(i_args: list[str]) -> None: # pylint: disable=too-complex diff --git a/test/test_main.py b/test/test_main.py index 400408e..7366247 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -35,3 +35,10 @@ class Test_main(unittest.TestCase): fct_main(["-h", "-pp", str(testdir_path.parent.resolve())]) self.assertIn(f"usage: {chacha_cicd_helper.__Name__}", capted_stdout.getvalue()) self.assertEqual(capted_stderr.getvalue(), "") + + @unittest.skip + def test_help_print(self): + with redirect_stdout(StringIO()) as capted_stdout, redirect_stderr(StringIO()) as capted_stderr: + with self.assertRaises(SystemExit): + fct_main(["-h", "-pp", str(testdir_path.parent.resolve())]) + print(capted_stdout.getvalue())