-
Notifications
You must be signed in to change notification settings - Fork 41
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
Keep group context between commands in repl 'state' ? #48
Comments
Seems interesting. My first intuition is to try to launch another repl from within the repl. Not sure if that works.
…On October 1, 2018 6:50:35 PM GMT+02:00, AlexV ***@***.***> wrote:
In my setup, it kind of makes sense to have one repl for one group with
multiple commands.
In that usecase, I would like the group context (ie. options passed to
the group, for all commands to use) to be kept in memory in the repl
between commands... and also accessing it via a 'context' command.
Any advice on the proper way to do this without breaking click context
handling ?
I am currently trying various things, as I couldn't find any
documentation about that use case ( which seems quite intuitive, to me
at least )
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#48
|
Let me try to iterate on that and hopefully make it clearer... $ my_click_mod.py --group_opt1 --group_opt2 command1 --cmd_opt1 --cmd_opt2
$ my_click_mod.py --group_opt1 command1 --cmd_opt1 --cmd_opt2
$ my_click_mod.py --group_opt1 command1 --cmd_opt1 To be equivalent as doing, in the repl :
Differences I can spot with the current simple way to do things :
OR (undecided)
Differences I can spot with the current simple way to do things :
In any case, it seems these would be useful:
I don't know if there is an easy way do any of these, other than modifying click-repl source ? |
In the third line, how do you know |
I would naively expect commands and all subcommands to be on the same call, ie. same line :
What I had in mind was to have a "one repl <-> one group" relationship. I have no idea however if, in click concepts, groups can be stacked up? So given yourfeedback, the second option might make more sense :
Note repls can be stacked up :
So I was thinking of the stack of repls mirroring the stack of click contexts : As far as I can recall, currently if you call the repl from a group, there is a discrepancy between calling via command line, where you need to access Note that I don't think it would bring much value to have one repl per level of command / subcomands, as it would merely be a helper for option completion. I find the idea of using a repl to navigate the multiple commands available in a shared group context much more appealing... |
In my setup, it kind of makes sense to have one repl for one group with multiple commands.
In that usecase, I would like the group context (ie. options passed to the group, for all commands to use) to be kept in memory in the repl between commands... and also accessing it via a 'context' command.
Any advice on the proper way to do this without breaking click context handling ?
I am currently trying various things, as I couldn't find any documentation about that use case ( which seems quite intuitive, to me at least )
The text was updated successfully, but these errors were encountered: