[elbe-devel] [PATCH 00/19] elbepack: migrate to argparse (1)

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Jul 9 09:23:33 CEST 2024


Migrate some of the easy-to-migrate subcommands from optparse to
argsparse.

argparse has various advantages over optparse:

* Autogenerated command synopsis.
* Required arguments.
* Flexible argument types.
* Subparsers.

Furthermore optparse is deprecated since Python 3.2 (2011).

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
Thomas Weißschuh (19):
      elbepack: parselicence: migrate to argparse
      elbepack: check-build: migrate to argparse
      elbepack: fetch_initvm_pkgs: migrate to argparse
      elbepack: cyclonedx-sbom: migrate to argparse
      elbepack: pkgdiff: migrate to argparse
      elbepack: validate: migrate to argparse
      elbepack: updated: migrate to argparse
      elbepack: daemon: migrate to argparse
      elbepack: show: migrate to argparse
      elbepack: test/updated: migrate to argparse
      elbepack: add: migrate to argparse
      elbepack: get_archive: migrate to argparse
      elbepack: check_updates: migrate to argparse
      elbepack: chroot: migrate to argparse
      elbepack: pin_versions: migrate to argparse
      elbepack: diff: migrate to argparse
      elbepack: repodir: migrate to argparse
      elbepack: chg_archive: migrate to argparse
      elbepack: setsel: migrate to argparse

 elbepack/commands/add.py               | 17 +++---
 elbepack/commands/check-build.py       | 28 ++++------
 elbepack/commands/check_updates.py     | 49 ++++++++---------
 elbepack/commands/chg_archive.py       | 23 ++++----
 elbepack/commands/chroot.py            | 45 +++++++---------
 elbepack/commands/cyclonedx-sbom.py    | 15 ++----
 elbepack/commands/daemon.py            | 20 +++----
 elbepack/commands/diff.py              | 30 +++++------
 elbepack/commands/fetch_initvm_pkgs.py | 99 ++++++++++++++++------------------
 elbepack/commands/get_archive.py       | 19 +++----
 elbepack/commands/parselicence.py      | 51 ++++++++----------
 elbepack/commands/pin_versions.py      | 27 ++++------
 elbepack/commands/pkgdiff.py           | 25 ++++-----
 elbepack/commands/repodir.py           | 28 +++++-----
 elbepack/commands/setsel.py            | 20 +++----
 elbepack/commands/show.py              | 38 ++++++-------
 elbepack/commands/updated.py           | 60 ++++++++++-----------
 elbepack/commands/validate.py          | 29 +++++-----
 test/updated.py                        | 34 ++++++------
 19 files changed, 286 insertions(+), 371 deletions(-)
---
base-commit: 7846c139efe72bca2de4211d011ae9769b32ed77
change-id: 20240708-argparse-0675a6929db5

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list