Docs don't mention when a class method is considered private v.s public / --help behavior is confusing
- Lingua principale
- Python
- Stelle
- 28.2k
- Fork
- 1.5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Here's a MWE:
```python
#!/usr/bin/env python
from fire import Fire
class Example:
def version(self):
return "bla"
def start(self):
print("starting")
def stop(self):
print("stopping")
Fire(Example)
```
Running this script without arguments shows the available commands - OK:
```
NAME
fire-bug.py
SYNOPSIS
fire-bug.py COMMAND
COMMANDS
COMMAND is one of the following:
start
stop
version
```
But the more common (and usually safe) thing to do when a user is being introduced a new command, is to run it with a `--help`. However, `Fire` doesn't behave the same for this argument:
```
INFO: Showing help with the command 'fire-bug.py -- --help'.
NAME
fire-bug.py
SYNOPSIS
fire-bug.py -
```
Unless you use `--verbose` as well. Why is that? This is not trivial for a user to guess, and only reading the docs here led me to this conclusion. Plus, the docs don't mention how to make a class method a "public" method...
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’MWE di Python Fire nell’issue e confronta il comportamento senza argomenti, con --help e con --verbose descritto lì. Aggiorna la documentazione pertinente per spiegare quando i metodi delle classi vengono esposti come pubblici o privati e perché queste invocazioni dell’help differiscono. Il lavoro è completato quando un nuovo contributore può determinare come rendere pubblico un metodo e comprendere il comportamento documentato di --help.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli, documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100