[update] implement '-U/--update'

to auto-update executable files in-place
This commit is contained in:
Mike Fährmann
2024-05-27 23:38:11 +02:00
parent 601f5becc8
commit 2e323ef0a2
3 changed files with 170 additions and 1 deletions

View File

@@ -173,6 +173,18 @@ def build_parser():
action="version", version=version.__version__,
help="Print program version and exit",
)
if util.EXECUTABLE:
general.add_argument(
"-U", "--update",
dest="update", action="store_const", const="latest",
help="Update to the latest version",
)
else:
general.add_argument(
"-U", "--update",
dest="update", action="store_const", const="check",
help="Check if a newer version is available",
)
general.add_argument(
"-f", "--filename",
dest="filename", metavar="FORMAT",