Skip to content

Commit

Permalink
add a 'version' subcommand
Browse files Browse the repository at this point in the history
Signed-off-by: JackSlateur <[email protected]>
  • Loading branch information
JackSlateur committed Sep 30, 2019
1 parent b419ef1 commit d394ac4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion man/backurne.1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ backurne \- backup Ceph's RBD on Ceph, with Proxmox integration
.B backurne
.RI list-mapped
.I [--json]

.br
.B backurne
.RI version

.SH DESCRIPTION
backurne is a handy tool for backuping RBD's image on RBD.
Expand Down Expand Up @@ -111,6 +113,10 @@ List mapped backups.
By default, a human friendly output is produced. Use
.I --json
for machine readable output.
.IP "\fBversion\fR" 4
version
.IP
Print the current version

.SH BUGS
No known bugs.
Expand Down
6 changes: 6 additions & 0 deletions src/backurne/backurne.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
from . import stats


VERSION = '0.2'


class Check:
def __init__(self, cluster):
self.cluster = cluster
Expand Down Expand Up @@ -613,6 +616,7 @@ def get_args():
sub.add_parser('check')
sub.add_parser('check-snap')
sub.add_parser('stats')
sub.add_parser('version')

ls = sub.add_parser('list-mapped')
ls.add_argument('--json', action='store_true')
Expand All @@ -635,6 +639,8 @@ def main():
args = get_args()
if args.action == 'stats':
stats.print_stats()
elif args.action == 'version':
print(f'Backurne version {VERSION}')
elif args.action == 'check':
print_check_results()
elif args.action in ('precheck', 'check-snap'):
Expand Down

0 comments on commit d394ac4

Please sign in to comment.