:py:mod:`buildtest.cli` ======================= .. py:module:: buildtest.cli .. autoapi-nested-parse:: buildtest cli: include functions to build, get test configurations, and interact with a global configuration for buildtest. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 build/index.rst buildspec/index.rst cd/index.rst cdash/index.rst clean/index.rst commands/index.rst compilers/index.rst config/index.rst debugreport/index.rst helpcolor/index.rst history/index.rst info/index.rst inspect/index.rst path/index.rst report/index.rst show/index.rst stats/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: buildtest.cli.BuildTestParser Functions ~~~~~~~~~ .. autoapisummary:: buildtest.cli.build_filters_format buildtest.cli.handle_kv_string buildtest.cli.positive_number buildtest.cli.supported_color buildtest.cli.valid_time buildtest.cli.get_parser Attributes ~~~~~~~~~~ .. autoapisummary:: buildtest.cli.BUILDTEST_COPYRIGHT buildtest.cli.BUILDTEST_VERSION buildtest.cli.console .. py:data:: BUILDTEST_COPYRIGHT :value: 'Copyright (c) 2021-2024, The Regents of the University of California, through Lawrence Berkeley...' .. py:data:: BUILDTEST_VERSION .. py:data:: console .. py:function:: build_filters_format(val) This method is used as validate argument type for ``buildtest build --filter``. This method returns a dict of key, value pairs where input is in the format **key1=val1,val2;key2=val3**. The semicolon is used to separate the keys and multiple values can be specified via comma :param val: Input string in ``key1=value1,val2;key2=value3`` format that is processed into a dictionary type :type val: str :returns: A dict mapping of key=value pairs :rtype: dict .. py:function:: handle_kv_string(val) This method is used as type field in --filter argument in ``buildtest buildspec find``. This method returns a dict of key,value pair where input is in format key1=val1,key2=val2,key3=val3 :param val: Input string in ``key1=value1,key2=value2`` format that is processed into a dictionary type :type val: str :returns: A dict mapping of key=value pairs :rtype: dict .. py:function:: positive_number(value) Checks if input is positive number and returns value as an int type. :param value: Specify an input number :type value: str or int :returns: Return value as int type :rtype: int :raises argparse.ArgumentTypeError will be raised if input is not positive number or input is not str or int type: >>> positive_number("1") 1 >>> positive_number(2) 2 .. py:function:: supported_color(input_color) Checks if input is a supported color and returns value as an Color type. :param input_color: Specify an input color :type input_color: str :returns: Return value as rich.color.Color type :rtype: str :raises argparse.ArgumentTypeError will be raised if input is not a supported color input or is not str type: >>> supported_color("red") red .. py:function:: valid_time(value) Checks if input is valid time and returns value as a str type. :param value: Specify an input date in yyyy-mm-dd format :type value: str :returns: Return value as str type in correct format :rtype: int :raises argparse.ArgumentTypeError will be raised if input is not str or input is not in desired format: >>> valid_time("2022-01-01") "2022-01-01" >>> valid_time("2022-01-13") "2022-01-13" .. py:function:: get_parser() This method is used to simply return the parser for sphinx-argparse. .. py:class:: BuildTestParser This class implements the buildtest command line interface. This class implements the following methods: - :func:`get_parser`: This method builds the command line interface for buildtest - :func:`parse`: This method parses arguments passed to buildtest command line interface .. py:attribute:: _github :value: 'https://github.com/buildtesters/buildtest' .. py:attribute:: _docs :value: 'https://buildtest.readthedocs.io/en/latest/index.html' .. py:attribute:: _slack :value: 'http://hpcbuildtest.slack.com/' .. py:attribute:: _issues :value: 'https://github.com/buildtesters/buildtest/issues' .. py:attribute:: _progname :value: 'buildtest' .. py:attribute:: _description :value: 'buildtest is a HPC testing framework for building and running tests.' .. py:attribute:: epilog_str .. py:attribute:: _buildtest_show_commands :value: ['bd', 'build', 'bc', 'buildspec', 'cdash', 'cg', 'config', 'hy', 'history', 'it', 'inspect',... .. py:method:: parse() This method parses arguments passed to buildtest command line interface. .. py:method:: get_subparsers() .. py:method:: retrieve_main_options() This method retrieves all options for buildtest command line interface. This is invoked by ``buildtest --listopts`` command and useful when user wants to see all options. .. py:method:: _build_subparsers() This method builds subparsers for buildtest command line interface. .. py:method:: _build_options() This method builds the main options for buildtest command line interface. .. py:method:: get_subcommands() Return a list of buildtest commands. This is useful for ``buildtest commands`` command to show a list of buildtest commands .. py:method:: get_parent_parser() .. py:method:: misc_menu() Build the command line menu for some miscellaneous commands .. py:method:: stylecheck_menu() This method will create command options for ``buildtest stylecheck`` .. py:method:: tutorial_menu() .. py:method:: unittest_menu() This method builds the command line menu for ``buildtest unittests`` command .. py:method:: path_menu() This method builds the command line menu for ``buildtest path`` command .. py:method:: history_menu() This method builds the command line menu for ``buildtest history`` command .. py:method:: build_menu() This method implements command line menu for ``buildtest build`` command. .. py:method:: buildspec_menu() This method implements ``buildtest buildspec`` command .. py:method:: buildspec_find_menu(buildspec_find_parser) .. py:method:: config_menu() This method adds argparse argument for ``buildtest config`` .. py:method:: report_menu() This method implements the ``buildtest report`` command options .. py:method:: inspect_menu() This method builds argument for ``buildtest inspect`` command .. py:method:: cdash_menu() This method builds arguments for ``buildtest cdash`` command.