Version flag alongside other commands
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Beginne damit, das gemeldete Verhalten mit Python Fire 0.5.0 unter Verwendung eines Callables zu reproduzieren, das mehrere Befehle bereitstellt, und verfolge dann, wie eigenständige Flags und die Kommandohilfe zusammengesetzt werden. Vergleiche foo --version, foo -v, foo --help und foo mycommand myarg; abgeschlossen ist die Aufgabe, wenn die Versions-Flags unabhängig funktionieren, in der relevanten Hilfeausgabe erscheinen und das bestehende Befehlsverhalten nicht verändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I have a script which has multiple commands, each of which have their own arguments etc. I would like to add a simple flag to be used standalone to simply display the version of my script. I would like the the --help display to additionally show users this flag is available without affecting the other commands. For instance if my script is called foo, I'd like to be able to do:
foo --version or foo -v
but I'd still like to do:
foo mycommand myarg etc.
The two closest solutions I've tried each have a downside:
- the flags and the commands are displayed in different help windows e.g.
foo --helpshows the help window for the flags whilstfoostandlone shows the help window for the commands - the help window shows both flags and commands but the flag is interpreted as a flag to the commands such that if I type
foo --version, the version is displayed but so is the help window because it thinks a command is missing
I'm using fire==0.5.0. Is there any way I can achieve this?
- Vorherrschende Sprache
- Python
- Sterne
- 28.2k
- Forks
- 1.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
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
-
namespace operations
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
EclipseFdn/open-vsx.org#13573 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
collective/icalendar#1854 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
rancher/rancher-ai-agent#412 ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
TUDelftGeodesy/DePSI#134 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
HenriquesLab/rxiv-maker#335 ·