generate_packets.py: Use argparse to handle command line arguments
Part of #43927. This also has the added benefit of easily providing help text and human-understandable error messages.
This patch only includes the parameters that were already being read from sys.argv, not the parameters hard-coded in the script – those are handled in #43938.
Part of #43927. This also has the added benefit of easily providing help text and human-understandable error messages.