mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
Merge pull request #670 from evandroforks/print_version
Create the command line argument -v/--version to print version
This commit is contained in:
commit
2cd86f38f4
1 changed files with 5 additions and 0 deletions
|
@ -309,6 +309,7 @@ def parseArgs(argv):
|
|||
parser.add_argument("-b", "--base", help="path to base folder", default="")
|
||||
parser.add_argument("-p", "--profile", help="profile name to load", default="")
|
||||
parser.add_argument("-l", "--lang", help="interface language (en, de, etc)")
|
||||
parser.add_argument("-v", "--version", help="print the Anki version and exit")
|
||||
return parser.parse_known_args(argv[1:])
|
||||
|
||||
|
||||
|
@ -412,6 +413,10 @@ def _run(argv=None, exec=True):
|
|||
# parse args
|
||||
opts, args = parseArgs(argv)
|
||||
|
||||
if opts.version:
|
||||
print(f"Anki version '{appVersion}'")
|
||||
return
|
||||
|
||||
if PROFILE_CODE:
|
||||
import cProfile
|
||||
|
||||
|
|
Loading…
Reference in a new issue