From e817657d017010711851a60399e737c23dae3edf Mon Sep 17 00:00:00 2001 From: Yama Date: Wed, 17 Jan 2024 23:02:51 +0100 Subject: [PATCH] remove old checks and notifications for error which are handled by `argparse` now --- swayrst/swayrst.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/swayrst/swayrst.py b/swayrst/swayrst.py index 2d7b45e..69eb6ab 100644 --- a/swayrst/swayrst.py +++ b/swayrst/swayrst.py @@ -49,6 +49,8 @@ appname = sys.argv[0] workspace_mapping = None debug = parser.parse_args().v +command = parser.parse_args().command +profile = parser.parse_args().profile defaulted = [] couldnt_find = [] touched = [] @@ -119,20 +121,7 @@ def get_app(tree, app): def main(): - try: - command = parser.parse_args().command - except IndexError: - command = None - try: - profile = parser.parse_args().profile - except IndexError: - profile = None - - if not command or not profile: - notify('Not enough parameters!', 'Exiting') - print(f'Usage: {sys.argv[0]} ') - sys.exit(1) - elif not PATH: + if not PATH: notify('Sway config not found!', 'Make sure to use a default config path (man sway)') print(f'Sway config not found! Make sure to use a default config path (man sway)') sys.exit(1)