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

Question about passing arguments #4

Open
andronat opened this issue Aug 25, 2014 · 2 comments
Open

Question about passing arguments #4

andronat opened this issue Aug 25, 2014 · 2 comments

Comments

@andronat
Copy link

Hello, thank you for your project, is really awesome, it helped me big time :)

I was wondering which is the right way and if it possible to pass arbitrary arguments on the worker function.

More specifically, my problem is that I have a script and I want to read some parameters from a file. Then, depending on some user input I want to handle those parameters (from the file) either on the standard process of the script or start a daemon and pass those parameters on the daemon. Up until now, I am declaring those parameters on either a global variable or I create a class. Is there any other way?

Thanks

@jnrbsn jnrbsn added this to the v1.1 milestone Apr 18, 2016
@jnrbsn
Copy link
Owner

jnrbsn commented Apr 18, 2016

@andronat: First, I apologize for the extremely delayed response. There's not currently a way to pass arguments to the worker function. Although, I'm considering this idea in the next version I work on.

@dev-zero
Copy link

Does that mean it is also not possible to pass arguments to a function when using the click integration?
E.g. is the following supposed to work (it currently doesn't)?

@click.command(cls=DaemonCLI, daemon_params={'pidfile': './fdaemon.pid'})
@click.option('--what', type=str)
def main(what):
     click.echo(what)

@jnrbsn jnrbsn modified the milestones: v1.1, v1.1.1 Dec 17, 2020
@jnrbsn jnrbsn removed this from the v1.1.1 milestone Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants