Updated for short options

This commit is contained in:
Dimitris Zlatanidis 2023-01-28 00:08:30 +02:00
parent 440fae31cd
commit 2d888739c0
2 changed files with 20 additions and 8 deletions

View file

@ -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,

View file

@ -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}] <packages>\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] <packages>\n'
f' slpkg [{self.cyan}COMMAND{self.endc}] [-f, find, -w, view, -s, search] <packages>\n'
f' slpkg [{self.cyan}COMMAND{self.endc}] [-e, dependees, -t, tracking] <packages>\n'
@ -41,12 +41,12 @@ class Usage(Configs):
f'[{self.cyan}COMMAND{self.endc}] <packages>\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} <packages> Build only the packages.\n'
f' {self.cyan}-i, install{self.endc} <packages> Build and install the packages.\n'
f' {self.cyan}-d, download{self.endc} <packages> Download only the scripts and sources.\n'