Skip to content

CommandLineParser

Qt Base Class: QCommandLineParser

Signature: QCommandLineParser(self) -> None

Base classes

Name Children Inherits
QCommandLineParser
PySide6.QtCore
QCommandLineParser(self) -> None

⋔ Inheritance diagram

graph TD
  1473299921408["core.CommandLineParser"]
  1473288991568["QtCore.QCommandLineParser"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473288991568 --> 1473299921408
  1473291690208 --> 1473288991568
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QCommandLineParser

Means for handling the command line options.

Source code in prettyqt\core\commandlineparser.py
class CommandLineParser(core.QCommandLineParser):
    """Means for handling the command line options."""

    def set_single_dash_word_option_mode(self, mode: SingleDashWordStr):
        """Set the single dash word option mode.

        Args:
            mode: single dash word option mode
        """
        self.setSingleDashWordOptionMode(SINGLE_DASH_WORD.get_enum_value(mode))

    def set_options_after_positional_arguments_mode(
        self, mode: SingleDashWordStr | mod.SingleDashWordOptionMode
    ):
        """Set the options after positional arguments mode.

        Args:
            mode: options after positional arguments mode
        """
        val = OPTIONS_AFTER_POS_ARG.get_enum_value(mode)
        self.setOptionsAfterPositionalArgumentsMode(val)

    def add_option(
        self,
        name: str,
        description: str | None = None,
        value_name: str | None = None,
        default_value: str | None = None,
    ) -> core.CommandLineOption:
        if description is None:
            description = ""
        if value_name is None:
            value_name = ""
        if default_value is None:
            default_value = ""
        option = core.CommandLineOption(name, description, value_name, default_value)
        self.addOption(option)
        return option

set_options_after_positional_arguments_mode(mode: SingleDashWordStr | mod.SingleDashWordOptionMode)

Set the options after positional arguments mode.

Parameters:

Name Type Description Default
mode SingleDashWordStr | SingleDashWordOptionMode

options after positional arguments mode

required
Source code in prettyqt\core\commandlineparser.py
def set_options_after_positional_arguments_mode(
    self, mode: SingleDashWordStr | mod.SingleDashWordOptionMode
):
    """Set the options after positional arguments mode.

    Args:
        mode: options after positional arguments mode
    """
    val = OPTIONS_AFTER_POS_ARG.get_enum_value(mode)
    self.setOptionsAfterPositionalArgumentsMode(val)

set_single_dash_word_option_mode(mode: SingleDashWordStr)

Set the single dash word option mode.

Parameters:

Name Type Description Default
mode SingleDashWordStr

single dash word option mode

required
Source code in prettyqt\core\commandlineparser.py
def set_single_dash_word_option_mode(self, mode: SingleDashWordStr):
    """Set the single dash word option mode.

    Args:
        mode: single dash word option mode
    """
    self.setSingleDashWordOptionMode(SINGLE_DASH_WORD.get_enum_value(mode))