third_party/blink/tools/blinkpy/style/optparser.py
def parse(self, args):
        """Parse the command line arguments to check_blink_style.py.

        Args:
          args: A list of command-line arguments as returned by sys.argv[1:].

        Returns:
          A tuple of (paths, options)

          paths: The list of paths to check.
          options: A CommandOptionValues instance.
        """
        (options, paths) = self._parser.parse_args(args=args)

        filter_value = options.filter_value
        git_commit = options.git_commit
        diff_files = options.diff_files
        is_verbose = options.is_verbose
        min_confidence = options.min_confidence
        output_format = options.output_format

        if filter_value is not None and not filter_value:
            # Then the user explicitly passed no filter, for
            # example "-f ''" or "--filter=".
            self._exit_with_categories()

        # Validate user-provided values.

        min_confidence = int(min_confidence)
        if (min_confidence < 1) or (min_confidence > 5):
            self._parse_error(
                'option --min-confidence: invalid integer: '
                '%s: value must be between 1 and 5' % min_confidence)

        if filter_value:
            filter_rules = self._parse_filter_flag(filter_value)
        else:
            filter_rules = []

        try:
            validate_filter_rules(filter_rules, self._all_categories)
        except ValueError as err:
            self._parse_error(err)

        options = CommandOptionValues(
            filter_rules=filter_rules,
            git_commit=git_commit,
            diff_files=diff_files,
            is_verbose=is_verbose,
            min_confidence=min_confidence,
            output_format=output_format)

        return (paths, options)
Parse the command line arguments to check_blink_style.py.

        Args:
          args: A list of command-line arguments as returned by sys.argv[1:].

        Returns:
          A tuple of (paths, options)

          paths: The list of paths to check.
          options: A CommandOptionValues instance.
        
Parse the command line arguments to check_blink_style.py.
Parse the command line arguments to check_blink_style . py .
def parse(self, args):
        (options, paths) = self._parser.parse_args(args=args)
        filter_value = options.filter_value
        git_commit = options.git_commit
        diff_files = options.diff_files
        is_verbose = options.is_verbose
        min_confidence = options.min_confidence
        output_format = options.output_format
        if filter_value is not None and not filter_value:
            self._exit_with_categories()
        min_confidence = int(min_confidence)
        if (min_confidence < 1) or (min_confidence > 5):
            self._parse_error(
                'option --min-confidence: invalid integer: '
                '%s: value must be between 1 and 5' % min_confidence)
        if filter_value:
            filter_rules = self._parse_filter_flag(filter_value)
        else:
            filter_rules = []
        try:
            validate_filter_rules(filter_rules, self._all_categories)
        except ValueError as err:
            self._parse_error(err)
        options = CommandOptionValues(
            filter_rules=filter_rules,
            git_commit=git_commit,
            diff_files=diff_files,
            is_verbose=is_verbose,
            min_confidence=min_confidence,
            output_format=output_format)
        return (paths, options)
def parse ( self , args ) : ( options , paths ) = self . _parser . parse_args ( args = args ) filter_value = options . filter_value git_commit = options . git_commit diff_files = options . diff_files is_verbose = options . is_verbose min_confidence = options . min_confidence output_format = options . output_format if filter_value is not None and not filter_value : self . _exit_with_categories ( ) min_confidence = int ( min_confidence ) if ( min_confidence < 1 ) or ( min_confidence > 5 ) : self . _parse_error ( 'option --min-confidence: invalid integer: ' '%s: value must be between 1 and 5' % min_confidence ) if filter_value : filter_rules = self . _parse_filter_flag ( filter_value ) else : filter_rules = [ ] try : validate_filter_rules ( filter_rules , self . _all_categories ) except ValueError as err : self . _parse_error ( err ) options = CommandOptionValues ( filter_rules = filter_rules , git_commit = git_commit , diff_files = diff_files , is_verbose = is_verbose , min_confidence = min_confidence , output_format = output_format ) return ( paths , options )
Parse the command line arguments to check_blink_style.py.
Parse the command line arguments to check_blink_style . py .
"""Parse the command line arguments to check_blink_style.py.

        Args:
          args: A list of command-line arguments as returned by sys.argv[1:].

        Returns:
          A tuple of (paths, options)

          paths: The list of paths to check.
          options: A CommandOptionValues instance.
        """ # Then the user explicitly passed no filter, for # example "-f ''" or "--filter=". # Validate user-provided values.
A tuple of (paths, options)

The list of paths to check.
options: A CommandOptionValues instance.
A tuple of ( paths options ) The list of paths to check . options : A CommandOptionValues instance .
self
args
A list of command-line arguments as returned by sys.argv[1:].
A list of command - line arguments as returned by sys . argv [ 1 : ] .