version info
This commit is contained in:
parent
053a40de38
commit
c8ff616cf9
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -36,10 +36,13 @@ jobs:
|
|||||||
cat build/chkbit/warn-chkbit.txt
|
cat build/chkbit/warn-chkbit.txt
|
||||||
cd dist; ls -l
|
cd dist; ls -l
|
||||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
|
./chkbit --version
|
||||||
tar -czf chkbit-linux_amd64.tar.gz chkbit
|
tar -czf chkbit-linux_amd64.tar.gz chkbit
|
||||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||||
|
./chkbit --version
|
||||||
tar -czf chkbit-macos_amd64.tar.gz chkbit
|
tar -czf chkbit-macos_amd64.tar.gz chkbit
|
||||||
elif [ "$RUNNER_OS" == "Windows" ]; then
|
elif [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
chkbit.exe --version
|
||||||
7z a -tzip chkbit-windows_amd64.zip chkbit.exe
|
7z a -tzip chkbit-windows_amd64.zip chkbit.exe
|
||||||
else
|
else
|
||||||
echo 'unknown runner'
|
echo 'unknown runner'
|
||||||
|
@ -10,6 +10,8 @@ from datetime import datetime, timedelta
|
|||||||
from chkbit import Context, Status, IndexThread
|
from chkbit import Context, Status, IndexThread
|
||||||
from . import CLI, Progress, RateCalc, sparkify
|
from . import CLI, Progress, RateCalc, sparkify
|
||||||
|
|
||||||
|
import importlib.metadata
|
||||||
|
|
||||||
|
|
||||||
EPILOG = """
|
EPILOG = """
|
||||||
.chkbitignore rules:
|
.chkbitignore rules:
|
||||||
@ -339,8 +341,16 @@ class Main:
|
|||||||
"-v", "--verbose", action="store_true", help="verbose output"
|
"-v", "--verbose", action="store_true", help="verbose output"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"-V", "--version", action="store_true", help="show version information"
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.version:
|
||||||
|
print(importlib.metadata.version("chkbit"))
|
||||||
|
return
|
||||||
|
|
||||||
self.verbose = args.verbose or args.show_ignored_only
|
self.verbose = args.verbose or args.show_ignored_only
|
||||||
if args.log_file:
|
if args.log_file:
|
||||||
self.log_verbose = args.log_verbose
|
self.log_verbose = args.log_verbose
|
||||||
|
Loading…
x
Reference in New Issue
Block a user