From fb3cb98793379fc7ee8f5c05f1b4215954ef1ea8 Mon Sep 17 00:00:00 2001 From: deeplow Date: Fri, 23 Dec 2022 11:17:11 +0000 Subject: [PATCH] Add --version flag --- dangerzone/cli.py | 1 + dangerzone/gui/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dangerzone/cli.py b/dangerzone/cli.py index e35c681..f617bfd 100644 --- a/dangerzone/cli.py +++ b/dangerzone/cli.py @@ -38,6 +38,7 @@ def print_header(s: str) -> None: type=click.UNPROCESSED, callback=args.validate_input_filenames, ) +@click.version_option(version=get_version(), message="%(version)s") @errors.handle_document_errors def cli_main( output_filename: Optional[str], diff --git a/dangerzone/gui/__init__.py b/dangerzone/gui/__init__.py index 4587839..5c0a7ca 100644 --- a/dangerzone/gui/__init__.py +++ b/dangerzone/gui/__init__.py @@ -13,7 +13,7 @@ from PySide2 import QtCore, QtGui, QtWidgets from .. import args, errors from ..document import Document -from ..util import get_resource_path +from ..util import get_resource_path, get_version from .logic import DangerzoneGui from .main_window import MainWindow @@ -55,6 +55,7 @@ class Application(QtWidgets.QApplication): type=click.UNPROCESSED, callback=args.validate_input_filenames, ) +@click.version_option(version=get_version(), message="%(version)s") @errors.handle_document_errors def gui_main(filenames: Optional[List[str]]) -> bool: setup_logging()