Skip to content

Commit f395ada

Browse files
Added --version command
1 parent a9ad1f5 commit f395ada

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bootstrap.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
print("> pip install pyliblzma")
6868
lzma_available = False
6969

70+
BOOTSTRAP_VERSION = "1.0.6 (2025)"
71+
7072
SRC_DIR_BASE = "src"
7173
ARCHIVE_DIR_BASE = "archives"
7274
SNAPSHOT_DIR_BASE = "snapshots"
@@ -488,6 +490,8 @@ def listLibraries(data):
488490

489491

490492
def printOptions():
493+
print("--------------------------------------------------------------------------------")
494+
print(BOOTSTRAP_VERSION)
491495
print("--------------------------------------------------------------------------------")
492496
print("Downloads external libraries, and applies patches or scripts if necessary.")
493497
print("If the --name argument is not provided, all available libraries will be")
@@ -528,6 +532,7 @@ def printOptions():
528532
print(" sources")
529533
print(" --debug-output Enables extra debugging output")
530534
print(" --break-on-first-error Terminate script once the first error is encountered")
535+
print(" --version Print the script version")
531536
print("--------------------------------------------------------------------------------")
532537

533538

@@ -541,7 +546,7 @@ def main(argv):
541546
"ln:N:cCb:h",
542547
["list", "name=", "name-file=", "skip=", "clean", "clean-all", "base-dir", "bootstrap-file=",
543548
"local-bootstrap-file=", "use-tar", "use-unzip", "repo-snapshots", "fallback-url=",
544-
"force-fallback", "debug-output", "help", "break-on-first-error"])
549+
"force-fallback", "debug-output", "help", "break-on-first-error", "version"])
545550
except getopt.GetoptError:
546551
printOptions()
547552
return 0
@@ -566,6 +571,9 @@ def main(argv):
566571
if opt in ("-h", "--help"):
567572
printOptions()
568573
return 0
574+
if opt in ("--version"):
575+
print(BOOTSTRAP_VERSION)
576+
return 0
569577
if opt in ("-l", "--list"):
570578
list_libraries = True
571579
if opt in ("-n", "--name"):

0 commit comments

Comments
 (0)