This commit is contained in:
Vinícius Moreira
2020-04-13 11:49:28 -03:00
parent 83aab1ff55
commit 01a60ea686
165 changed files with 12778 additions and 6171 deletions

View File

@@ -1,17 +1,19 @@
import argparse
import logging
import os
from argparse import Namespace
from bauh import __app_name__, __version__
def read() -> Namespace:
parser = argparse.ArgumentParser(prog=__app_name__, description="GUI for Linux package management")
parser = argparse.ArgumentParser(prog=__app_name__, description="GUI for Linux software management")
parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__))
parser.add_argument('--tray', action="store", default=os.getenv('BAUH_TRAY', 0), choices=[0, 1], type=int,
help='If the tray icon and update-check daemon should be created. Default: %(default)s')
parser.add_argument('--logs', action="store", default=int(os.getenv('BAUH_LOGS', 0)), choices=[0, 1], type=int, help='If the application logs should be displayed. Default: %(default)s')
parser.add_argument('--show-panel', action="store_true", help='Shows the management panel after the app icon is attached to the tray.')
parser.add_argument('--reset', action="store_true", help='Removes all configuration and cache files')
parser.add_argument('--logs', action="store_true", help='It activates {} logs.'.format(__app_name__))
exclusive_args = parser.add_mutually_exclusive_group()
exclusive_args.add_argument('--tray', action="store_true", help='If {} should be attached to the system tray.'.format(__app_name__))
exclusive_args.add_argument('--settings', action="store_true", help="Display only the settings panel")
exclusive_args.add_argument('--reset', action="store_true", help='Remove all configuration and cache files')
parser.add_argument_group(exclusive_args)
return parser.parse_args()