Passing custom command line argument to faust app
Checklist
- [x] I have included information about relevant versions
- [x] I have verified that the issue persists when using the
masterbranch of Faust.
Steps to reproduce
I need to pass a custom command line argumen to faust app.
Example:
python src/app.py worker my-argument
This however lead to an Error: no such option: my-argument
Looks like it is possible to pass only arguments known to faust, and there is no option to pass custom ones.
Expected behavior
Have a possibility for passing custom arguments to the app.
Actual behavior
Error: no such option: my-argument
Versions
- Python version 3.9
- Faust version 0.8.4
- Operating system Mac OS
- Kafka version 2.7.x
It depends on your use-case, but I've personally had success using argparse and passing the arguments to sys.argv. You can take a look at https://stackoverflow.com/questions/72182252/how-to-specify-faust-arguments-when-using-app-main/72231794#72231794 to know more.
To build this into faust, changes would have to be made in faust.cli.worker.worker which isn't exactly intended to be modified.