From c9fa6d174d87ac49c862e9852102c8c1f3c1e4ab Mon Sep 17 00:00:00 2001 From: Hans Fangohr <hans.fangohr@mpsd.mpg.de> Date: Wed, 14 Jun 2023 12:34:34 +0200 Subject: [PATCH] improve documentation --- mpsd-software.py | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/mpsd-software.py b/mpsd-software.py index bfeb5a5..07ecabe 100755 --- a/mpsd-software.py +++ b/mpsd-software.py @@ -26,13 +26,41 @@ else: rich_available = True -about_tool = """ +about_intro = f""" Build toolchains using Spack.\n -This function builds toolchains for MPSD-HPC at the appropriate directory, \n -for given system architecture and MPSD software stack version.\n -The toolchains -are built using the bash script spack_setup.sh, and the results are logged. """ +This function builds toolchains for MPSD-HPC at the appropriate directory, +for given system architecture and MPSD software stack version. The toolchains +are built using the bash script spack_setup.sh, and the results are logged. + +Command line usage: + + $> {sys.argv[0]} + +""" + + +about_epilog = f""" + + +Examples: + +1. Query what package sets and toolchains are available in relase dev-23a + + $> {sys.argv[0]} available dev-23a + +2. Install foss2022a-serial toolchain + + $> {sys.argv[0]} install dev-23a foss2022a-serial + +3. Check what package sets and toolchains are installed from release dev-23a + + $> {sys.argv[0]} status dev-23a + +Documentation: https://gitlab.gwdg.de/mpsd-cs/mpsd-software/-/blob/main/README.rst + +""" + call_date_iso = ( datetime.datetime.now().replace(microsecond=0).isoformat().replace(":", "-") @@ -1032,7 +1060,8 @@ def environment_status(mpsd_release: str, root_dir: Union[str, Path]) -> dict: def main(): """Execute main entry point.""" - parser = argparse.ArgumentParser(description=about_tool) + parser = argparse.ArgumentParser(description=about_intro, epilog=about_epilog, + formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument( "--log", "-l", -- GitLab