File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,15 @@ def get_subcommand(subcommand):
742
742
743
743
744
744
745
+ @subcommand
746
+ def version ():
747
+ """
748
+ Print blurb version.
749
+ """
750
+ print ("blurb version" , __version__ )
751
+
752
+
753
+
745
754
@subcommand
746
755
def help (subcommand = None ):
747
756
"""
@@ -818,6 +827,8 @@ def help(subcommand=None):
818
827
819
828
# Make "blurb --help" work.
820
829
subcommands ["--help" ] = help
830
+ subcommands ["--version" ] = version
831
+ subcommands ["-v" ] = version
821
832
822
833
823
834
@subcommand
@@ -1205,7 +1216,7 @@ def main():
1205
1216
fn = get_subcommand (subcommand )
1206
1217
1207
1218
# hack
1208
- if fn in (test , help ):
1219
+ if fn in (help , test , version ):
1209
1220
sys .exit (fn (* args ))
1210
1221
1211
1222
try :
Original file line number Diff line number Diff line change @@ -19,5 +19,7 @@ commands =
19
19
{posargs}
20
20
blurb test
21
21
blurb help
22
+ blurb --version
22
23
{envpython} -I -m blurb test
23
24
{envpython} -I -m blurb help
25
+ {envpython} -I -m blurb version
You can’t perform that action at this time.
0 commit comments