Skip to content

Commit

Permalink
Add --version
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Nov 16, 2024
1 parent ff71bc2 commit 0c95923
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions qubesadmin/backup/dispvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class RestoreInDisposableVM:
'auto_close': Option(('--auto-close',), skip),
# make the verification easier, those don't really matter
'help': Option(('--help', '-h'), skip),
'version': Option(('--version',), skip),
'force_root': Option(('--force-root',), skip),
}

Expand Down
5 changes: 5 additions & 0 deletions qubesadmin/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import sys
import textwrap

import pkg_resources

import qubesadmin.log
import qubesadmin.exc
import qubesadmin.vm
Expand Down Expand Up @@ -369,6 +371,9 @@ def __init__(self, vmname_nargs=None, show_forceroot=False, **kwargs):
self.add_argument('--help', '-h', action=SubParsersHelpAction,
help='show this help message and exit')

self.add_argument('--version', action='version', version= \
pkg_resources.require('qubesadmin')[0].version)

if self._vmname_nargs in [argparse.ZERO_OR_MORE, argparse.ONE_OR_MORE]:
vm_name_group = VmNameGroup(self,
required=(self._vmname_nargs
Expand Down

0 comments on commit 0c95923

Please sign in to comment.