Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more documentation #98

Open
FergusFettes opened this issue May 5, 2023 · 3 comments
Open

Adding more documentation #98

FergusFettes opened this issue May 5, 2023 · 3 comments

Comments

@FergusFettes
Copy link

Am I right in thinking that the README is the only documentation for this project?

It seems like there are a lot of cool features that are undocumented, for example:

And I'm also wondering if there is some way to make the repl run by default-- thats how it works in click-shell and its quite a nice feature (so you don't always need to write 'command repl').

Great project though! Just a touch more documentation would be super cool.

@GhostOps77
Copy link
Contributor

GhostOps77 commented May 13, 2023

As u can see, click-shell uses its custom click.Group-like class to run the CLI app
And also as u said, u can run your repl by default like this

# file.py
import click
from click_repl import register_repl

@click.group(invoke_without_command=True)
@click.pass_context
def cli(ctx):
    if ctx.invoked_subcommand is None:
        click_repl.repl(ctx)

@cli.command()
def hello():
    click.echo("Hello world!")

cli()
$ python file.py
> # prompts for input

This only works if u run/execute ur CLI app by invoking only its main CLI group, doesn't work for subcommands like that

@GhostOps77
Copy link
Contributor

I would actually say that its like giving permission to the dev to run repl whenever they want. Its not like they have to execute right after the moment they call the group

By this implementation, they can even run repl at certain condition if defined

Also, I agree that the documentation is incomplete. A PR for that would be nice

@FergusFettes
Copy link
Author

I decided to go with click-shell for the moment and even made a version for typer: https://github.com/fergusfettes/typer-shell

I am interested in what this package does differently so maybe one day I come back to this, and if I do I will do some documentation. But for now I'm working on typer-shell things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants