Version flag alongside other commands
まだ誰も着手していません。
評価
調査の方向性
まず、複数のコマンドを公開する callable を使って Python Fire 0.5.0 で報告された動作を再現し、次にスタンドアロンフラグとコマンドヘルプがどのように組み立てられるかを追跡します。foo --version、foo -v、foo --help、foo mycommand myarg を比較します。バージョンフラグが独立して機能し、該当するヘルプ出力に表示され、既存のコマンド動作を変更しなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- Python
- スター
- 28.2k
- フォーク
- 1.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/python-fire のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
google/python-fire#693 ·
-
Release 0.7.2? オープン
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
google/python-fire#698 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
google/python-fire#672 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
google/python-fire#665 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
google/python-fire#659 · コメント 1 件 ·
google/python-fire の issue をすべて見る
似ている issue
-
Add: hunch オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DiamondLightSource/dodal#2211 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openml/openml-python#1749 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sipyourdrink-ltd/bernstein#6191 ·