зеркало из https://github.com/mozilla/ff-tool.git
feat: add ff-tool --version flag (#89)
* feat: add --version flag Closes #61 * style: flake8 fix
This commit is contained in:
Родитель
19737ea9e3
Коммит
2ff1bf4ef8
|
@ -74,4 +74,11 @@ def arg_parser():
|
|||
directory"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-v',
|
||||
'--version',
|
||||
action='store_true',
|
||||
help="Print ff-tool version, then quit."
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from outlawg import Outlawg
|
||||
from fftool import PATH_PREFS_ROOT
|
||||
from fftool import PATH_PREFS_ROOT, __version__
|
||||
from arg_parser import arg_parser
|
||||
from firefox_download import download
|
||||
from firefox_profile import create_mozprofile, clean_profiles
|
||||
|
@ -14,6 +14,10 @@ def main():
|
|||
Log.header('FF-TOOL: download, install & launch Firefox!', 'XL', '=')
|
||||
options = arg_parser()
|
||||
|
||||
if options.version:
|
||||
print('FF-TOOL VERSION: {0}'.format(__version__))
|
||||
return
|
||||
|
||||
if options.app and not PATH_PREFS_ROOT:
|
||||
Log.header("ERROR")
|
||||
print("Missing path to $PATH_PREFS_ROOT directory.")
|
||||
|
|
Загрузка…
Ссылка в новой задаче