Parse command line arguments.
()
| 67 | |
| 68 | # ---------------------------------------------------------------------------- |
| 69 | def parse_args() -> argparse.Namespace: |
| 70 | """ |
| 71 | Parse command line arguments. |
| 72 | """ |
| 73 | parser = argparse.ArgumentParser( |
| 74 | description=__doc__, |
| 75 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 76 | ) |
| 77 | parser.add_argument( |
| 78 | "-p", |
| 79 | "--search-plugins", |
| 80 | action="store_true", |
| 81 | help=""" |
| 82 | In addition of ELF_FILEs and their linked dynamic libraries, also scan |
| 83 | the DPDK plugins path. |
| 84 | """, |
| 85 | ) |
| 86 | parser.add_argument( |
| 87 | "-v", |
| 88 | "--verbose", |
| 89 | action="count", |
| 90 | default=0, |
| 91 | help=""" |
| 92 | Display warnings due to linked libraries not found or ELF/JSON parsing |
| 93 | errors in these libraries. Use twice to show debug messages. |
| 94 | """, |
| 95 | ) |
| 96 | parser.add_argument( |
| 97 | "elf_files", |
| 98 | metavar="ELF_FILE", |
| 99 | nargs="+", |
| 100 | type=existing_file, |
| 101 | help=""" |
| 102 | DPDK application binary or dynamic library. |
| 103 | """, |
| 104 | ) |
| 105 | return parser.parse_args() |
| 106 | |
| 107 | |
| 108 | # ---------------------------------------------------------------------------- |