google / google/python-fire

Inconsistent behaviour between --help and no arguments

未關閉
#438 1 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
28.2k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

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](https://github.com/jeanCarloMachado/PythonSearch/blob/improve_webservice/python_search/cli.py#L17) 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 |

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
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。