From 2d888739c0b89584f13c6d2b438a7cf631fc26cd Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 28 Jan 2023 00:08:30 +0200 Subject: [PATCH] Updated for short options --- slpkg/main.py | 12 ++++++++++++ slpkg/views/cli_menu.py | 16 ++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 9bb7f80f..fcd04e5b 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -242,6 +242,12 @@ class Argparse(Configs): commands['-h'] = commands['--help'] commands['-v'] = commands['--version'] + commands['-u'] = commands['update'] + commands['-U'] = commands['upgrade'] + commands['-cu'] = commands['check-updates'] + commands['-g'] = commands['configs'] + commands['-cl'] = commands['clean-logs'] + commands['-ct'] = commands['clean-tmp'] commands['-b'] = commands['build'] commands['-i'] = commands['install'] commands['-d'] = commands['download'] @@ -560,11 +566,17 @@ def main(): '-v': argparse.version, '--version': argparse.version, 'update': argparse.update, + '-u': argparse.update, 'upgrade': argparse.upgrade, + '-U': argparse.upgrade, 'check-updates': argparse.check_updates, + '-cu': argparse.check_updates, 'configs': argparse.edit_configs, + '-g': argparse.edit_configs, 'clean-logs': argparse.clean_logs, + '-cl': argparse.clean_logs, 'clean-tmp': argparse.clean_tmp, + '-ct': argparse.clean_tmp, 'build': argparse.build, '-b': argparse.build, 'install': argparse.install, diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 281bd80d..0d0c9adc 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -20,8 +20,8 @@ class Usage(Configs): """ Prints the short menu. """ args = ( f'Usage: {Configs.prog_name} [{self.yellow}OPTIONS{self.endc}] [{self.cyan}COMMAND{self.endc}] \n' - f'\n slpkg [{self.cyan}COMMAND{self.endc}] [update, upgrade, check-updates, configs]\n' - f' slpkg [{self.cyan}COMMAND{self.endc}] [clean-logs, clean-tmp]\n' + f'\n slpkg [{self.cyan}COMMAND{self.endc}] [-u, update, -U, upgrade, -cu, check-updates, -g, configs]\n' + f' slpkg [{self.cyan}COMMAND{self.endc}] [-cl, clean-logs, -ct, clean-tmp]\n' f' slpkg [{self.cyan}COMMAND{self.endc}] [-b, build, -i, install, -d, download, -r, remove] \n' f' slpkg [{self.cyan}COMMAND{self.endc}] [-f, find, -w, view, -s, search] \n' f' slpkg [{self.cyan}COMMAND{self.endc}] [-e, dependees, -t, tracking] \n' @@ -41,12 +41,12 @@ class Usage(Configs): f'[{self.cyan}COMMAND{self.endc}] \n' f'\n{self.bold}DESCRIPTION:{self.endc} Packaging tool that interacts with the SBo repository.\n' f'\n{self.bold}COMMANDS:{self.endc}\n' - f' {self.red}update{self.endc} Update the package lists.\n' - f' {self.cyan}upgrade{self.endc} Upgrade all the packages.\n' - f' {self.cyan}check-updates{self.endc} Check for news on ChangeLog.txt.\n' - f' {self.cyan}configs{self.endc} Edit the configuration file.\n' - f' {self.cyan}clean-logs{self.endc} Clean dependencies log tracking.\n' - f' {self.cyan}clean-tmp{self.endc} Delete all the downloaded sources.\n' + f' {self.red}-u, update{self.endc} Update the package lists.\n' + f' {self.cyan}-U, upgrade{self.endc} Upgrade all the packages.\n' + f' {self.cyan}-cu, check-updates{self.endc} Check for news on ChangeLog.txt.\n' + f' {self.cyan}-g, configs{self.endc} Edit the configuration file.\n' + f' {self.cyan}-cl, clean-logs{self.endc} Clean dependencies log tracking.\n' + f' {self.cyan}-ct, clean-tmp{self.endc} Delete all the downloaded sources.\n' f' {self.cyan}-b, build{self.endc} Build only the packages.\n' f' {self.cyan}-i, install{self.endc} Build and install the packages.\n' f' {self.cyan}-d, download{self.endc} Download only the scripts and sources.\n'