CESNET / Nemea-Framework

Nemea framework is the heart of the Nemea system. It contains implementation of common communication interfaces, UniRec data format and useful datastructures and algorithms.
11 stars 24 forks source link

Python Module Commandline Arguments #74

Open rickhg12hs opened 6 years ago

rickhg12hs commented 6 years ago

How can Python Module commandline arguments be defined and used?

I see in README.md...

NOTE: ./python_example.py claims that it has additional parameters -f and -q. However, these parameters have no effect. They are listed just for a demonstration of the optparse.OptionParser class that can be used in python Nemea modules for unified help output.

... but looking at the source, there is no mention of the additional parameters.

Are additional parameters possible?

rickhg12hs commented 6 years ago

... Ah, OK. Looks like I need to do my own argparse before calling TrapCtx.init with the remaining commandline args.

rickhg12hs commented 6 years ago

... Although....

What is your recommended method to include Python module commandline arguments? TrapCtx has it's own argument parsing and help. How should more parameters be integrated?