-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for docker
like arguments termination
#360
Comments
I'd say that it's not a good idea to wrap existing CLIs with Click, because click has many opinions on e.g. helptext formatting that allow you to create nice CLIs very quickly, but not exactly replicate existing ones.
That's wrong, it seems to terminate the options. You can do the same with Click:
In this case the |
@untitaker that's not what I want. For example: #!/usr/bin/env python
import click
@click.group()
def cli():
pass
@cli.command()
@click.argument('image')
@click.argument('command', nargs=-1)
def run(image, command):
print 'image', image
print 'command', command
cli() Then, if I do something like:
It works ok. But when I do something like:
The behavior I want is "IMAGE" to terminate the arguments so I'll be able to read ('a b', 'c', 'd', '--arg') |
I see, but again, it's not arguments, you mean options. |
@untitaker I mentioned wanting to imply |
@untitaker could you give me a lead on how to implement this? I'll do it and create a pull request |
You should be able to implement this by making an |
@mitsuhiko |
|
Removing the parsing for |
Closing this it seems like it would be really difficult to implement per mitsuhiko, and the use case looks somewhat limited. |
Is it possible to replace the
--
termination with something else?I would like to wrap the
docker run
command with my own, preserving thedocker
behaviour.The
docker run
command arguments are:The
IMAGE
parameter terminates the command line arguments (and is retrievable from the command line parser). I would like to do the same with click. Essentially, this means that the--
termination would be configurable and retrievable.The implementation I had in mind is specifying an extra keyword argument to the
@click.argument()
decorator (something like terminating=True)Any thoughts?
The text was updated successfully, but these errors were encountered: