File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,19 @@ def restore_cursor():
3535 sys .stdout .write ("\033 [?25h" ) # ANSI escape code to show cursor
3636
3737
38+ def get_version ():
39+ return pkg_resources .get_distribution ("unblob" ).version
40+
41+
42+ def show_version (
43+ ctx : click .Context , _param : click .Option , value : bool # noqa: FBT001
44+ ) -> None :
45+ if not value or ctx .resilient_parsing :
46+ return
47+ click .echo (get_version ())
48+ ctx .exit (code = 0 )
49+
50+
3851def show_external_dependencies (
3952 ctx : click .Context , _param : click .Option , value : bool # noqa: FBT001
4053) -> None :
@@ -198,6 +211,13 @@ def __init__(
198211 callback = show_external_dependencies ,
199212 expose_value = False ,
200213)
214+ @click .option (
215+ "--version" ,
216+ help = "Shows unblob version" ,
217+ is_flag = True ,
218+ callback = show_version ,
219+ expose_value = False ,
220+ )
201221def cli (
202222 file : Path ,
203223 extract_root : Path ,
You can’t perform that action at this time.
0 commit comments