feature request: tell fire to stop parsing argument and pass the remaining unparsed args to function
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne beim fire.Fire-Einstiegspunkt und untersuche, wie Befehlszeilenargumente geparst werden, bevor der vorgeschlagene fire.decorators.SkipParse-Methodenaufruf erreicht wird. Definiere, wie eine Markierung oder ein Decorator zum Beenden des Parsens sich verhalten soll, und überprüfe, dass das Beispiel ('which', '-a', 'python3') nach run beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Feature Description
I am working on a tool to wrap some existed command line tools to make them easier to use (like auto install, inject argument automatically, etc). And I hope that I can have a way to tell Fire to stop parsing after encount some specific command.
Example
Here are some real world examples like poetry run python3 ./my-scripts.py or conda run -n my-env python3 ./my-scripts.py
Without this feature I can only put everything else as string, just like what -c option of bash does, e.g. bash -c "echo 'hello world'" , which could still work, but the user have to type extra string quote and dealing with escaping in some cases.
I am not sure if it is possbile to provide some decorator to archive this, for example
class Conda:
def __init__(verbose=False):
...
@fire.decorators.SkipParse
def run(self, *argv):
print(argv)
fire.Fire(Conda)
And when running with python fake-conda.py --verbose run which -a python3, the output should be ('which', '-a', 'python3')
- Vorherrschende Sprache
- Python
- Sterne
- 28.2k
- Forks
- 1.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/python-fire
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
google/python-fire#693 ·
-
Release 0.7.2? Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
google/python-fire#698 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
google/python-fire#672 · 5 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
google/python-fire#665 · 2 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
google/python-fire#659 · 1 Kommentar ·
Alle Issues in google/python-fire
Ähnliche Issues
-
essnmx good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
[Feature] 奇物选择添加优先级 Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
syfoud/Simulated_Scepter#174 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Giskard-AI/giskard-oss#2840 · 1 Kommentar ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Offenarea: repo bug perceived difficulty: 2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
yeti-platform/yeti#1380 ·