sys/log: Add option to list available logs via cli
Use 'log -l' for this.
@@ -214,8 +214,11 @@ shell_log_dump_cmd(int argc, char **argv)
struct log *log;
struct log_offset log_offset;
bool last = false;
+ bool list_only;
int rc;
+ list_only = ((argc > 1) && !strcmp(argv[1], "-l"));
+
log = NULL;
do {
log = log_list_get_next(log);
@@ -227,6 +230,11 @@ shell_log_dump_cmd(int argc, char **argv)
continue;
}
+ if (list_only) {
+ console_printf("%s\n", log->l_name);
+ continue;
+ }
+
if (argc > 1) {
if (strcmp(log->l_name, argv[1])) {
continue;
