mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-05 08:46:20 +01:00
Updated for cli
This commit is contained in:
parent
f6be71a65d
commit
deeaae364c
1 changed files with 21 additions and 6 deletions
|
@ -59,7 +59,7 @@ class NewConfig:
|
|||
""" Checks for .new files. """
|
||||
print('Checking for NEW configuration files...')
|
||||
if self.slpkg_config_new.is_file() or self.blacklist_config_new.is_file():
|
||||
print('There are NEW files:\n')
|
||||
print('\nThere are NEW files:\n')
|
||||
|
||||
if self.slpkg_config_new.is_file():
|
||||
print(f"{self.bgreen:>12}{self.slpkg_config_new}{self.endc}")
|
||||
|
@ -205,11 +205,26 @@ class NewConfig:
|
|||
if __name__ == '__main__':
|
||||
args = sys.argv
|
||||
args.pop(0)
|
||||
if '--help' in args or '-h' in args:
|
||||
print('slpkg_new-configs [OPTIONS]\n'
|
||||
'\n--no-colors Disable the output colors.\n'
|
||||
'-h, --help Show this message and exit.\n')
|
||||
sys.exit()
|
||||
|
||||
options: list = [
|
||||
'--no-colors',
|
||||
'-h', '--help'
|
||||
]
|
||||
|
||||
if len(args) == 1:
|
||||
if options[1] in args or options[2] in args:
|
||||
print('slpkg_new-configs [OPTIONS]\n'
|
||||
'\n --no-colors Disable the output colors.\n'
|
||||
' -h, --help Show this message and exit.\n')
|
||||
sys.exit()
|
||||
elif args[0] == options[0]:
|
||||
pass
|
||||
else:
|
||||
print('\ntry: slpkg_new-configs --help\n')
|
||||
sys.exit(1)
|
||||
elif len(args) > 1:
|
||||
print('\ntry: slpkg_new-configs --help\n')
|
||||
sys.exit(1)
|
||||
|
||||
config = NewConfig(args)
|
||||
config.check()
|
||||
|
|
Loading…
Add table
Reference in a new issue