Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Inconsistent behaviour between --help and no arguments

未关闭
#438 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli

调研方向

首先,使用 issue 中链接的 PythonSearch 示例重现不带参数和使用 --help 之间的差异,然后跟踪每种调用方式的 CLI 帮助生成路径。完成的标准是:两种方式都显示相同的类选项,包括实例级命令,同时不丢失现有的帮助输出。

由索引模型根据 Issue 内容生成。

描述

I'm a big fan of Python Fire, it's been a huge help in building my projects. I have a small improvement request: I noticed that when I don't pass any arguments to my Fire program, I get an overview of all options of my class. However, when I pass --help, it only describes the class-level functions and misses out the instance-level ones.

I would love to see consistent behavior between the two approaches, ideally it should print all options of the class in both cases.

Thank you for your time!

Example of a personal project.

$ python_search
NAME
    python_search - Welcome to PythonSearch, An open-source assistant that helps you collect, retrieve and refactor information (and programs) efficiently using Python

SYNOPSIS
    python_search - GROUP | COMMAND

DESCRIPTION
    Welcome to PythonSearch, An open-source assistant that helps you collect, retrieve and refactor information (and programs) efficiently using Python

GROUPS
    GROUP is one of the following:

     configuration
       The main _configuration of Python Search Everything to customize about the application is configurable via code through this class

COMMANDS
    COMMAND is one of the following:

     configure_shortcuts
       Generate shortcuts for the current configuration

     install_missing_dependencies
       Install all missing dependencies that cannot be provided through the default installer

     new_project
       Create a new project in the current directory with the given name

     register_new_ui
       Starts the UI for collecting a new entry into python search

     run_key
       Runs an entry given its name or its partial name.

     search
       Opens the Search UI. Main entrypoint of the application

     set_project_location
       If you have a python search project already you can specify its location with this command

And with the --help with less content

$ python_search --help
NAME
    python_search - Welcome to PythonSearch, An open-source assistant that helps you collect, retrieve and refactor information (and programs) efficiently using Python

SYNOPSIS
    python_search COMMAND | <flags>

DESCRIPTION
    Welcome to PythonSearch, An open-source assistant that helps you collect, retrieve and refactor information (and programs) efficiently using Python

FLAGS
    --configuration=CONFIGURATION
        Type: Optional[Optional]
        Default: None

COMMANDS
    COMMAND is one of the following:

     install_missing_dependencies
       Install all missing dependencies that cannot be provided through the default installer

     new_project
       Create a new project in the current directory with the given name

     set_project_location
       If you have a python search project already you can specify its location with this command
主要语言
Python
星标
28.2k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/python-fire 的其他 Issue

查看 google/python-fire 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。