Skip to content

Commit fa17fa8

Browse files
authored
Merge pull request #284 from github/add-version-flag
Add --version flag to all commands
2 parents 69cf114 + 9559dbd commit fa17fa8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

bin/ghe-backup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
#/ Usage: ghe-backup [-v]
2+
#/ Usage: ghe-backup [-v] [--version]
33
#/ Take snapshots of all GitHub Enterprise data, including Git repository data,
44
#/ the MySQL database, instance settings, GitHub Pages data, etc.
55
#/

bin/ghe-restore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#/ argument is provided, it always overrides the configured restore host.
77
#/
88
#/ Options:
9+
#/ --version Display version information.
910
#/ -f Don't prompt for confirmation before restoring.
1011
#/ -c Restore appliance settings and license in addition to
1112
#/ datastores. Settings are not restored by default to

share/github-backup-utils/ghe-backup-config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
2525

2626
. $GHE_BACKUP_ROOT/share/github-backup-utils/bm.sh
2727

28+
# Display version string if flag present for any command
29+
if [ "$1" = "--version" ]; then
30+
echo "GitHub backup-utils v$BACKUP_UTILS_VERSION"
31+
exit 0
32+
fi
33+
2834
# Parse out -v (verbose) argument
2935
if [ "$1" = "-v" ]; then
3036
GHE_VERBOSE=true

0 commit comments

Comments
 (0)