fix usage and listing

This commit is contained in:
2026-08-02 07:49:16 +03:00
parent 85c97bcf12
commit 1aff092d62
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -96,8 +96,8 @@ def get_services(db):
GROUP BY GROUP BY
service.name; service.name;
''') ''')
db.commit()
ret = {name: failures for (name, failures) in cur.fetchall()} ret = {name: failures for (name, failures) in cur.fetchall()}
db.commit()
return ret return ret
+6 -1
View File
@@ -96,7 +96,11 @@ documentation for details.''')
help='''Force clear for all services if service is help='''Force clear for all services if service is
not specified''') not specified''')
return parser.parse_args() args = parser.parse_args()
if not args.cmd:
parser.print_help()
sys.exit(1)
return args
def cli(): def cli():
config = configparser.ConfigParser() config = configparser.ConfigParser()
@@ -116,6 +120,7 @@ def cli():
cli_list(args, db) cli_list(args, db)
elif args.cmd == 'clear': elif args.cmd == 'clear':
cli_clear(args, db) cli_clear(args, db)
else:
sysalert.db.close(db) sysalert.db.close(db)
return ret return ret