Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  custom_parser.py   Sprache: Python

 

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse

from mach.decorators import Command


class CustomParser(argparse.ArgumentParser):
    """A parser that stashes unrecognized args into extra_args and returns
    an empty remainder list, the same way MozlintParser does."""

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.add_argument("-l", "--linter", dest="linter", default=None)
        self.add_argument(
            "extra_args",
            nargs=argparse.REMAINDER,
            default=[],
        )

    def parse_known_args(self, *args, **kwargs):
        namespace, extra = super().parse_known_args(*args, **kwargs)
        namespace.extra_args = extra
        return namespace, []


def setup_custom_parser():
    return CustomParser()


@Command(
    "cmd_custom_parser",
    category="testing",
    parser=setup_custom_parser,
)
def run_custom_parser(command_context, extra_args=None, **kwargs):
    print(" ".join(extra_args or []))

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-10-06) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691