From 5aeda2b13973325de30c981980fba36b9e63f838 Mon Sep 17 00:00:00 2001 From: Nikolay Ambartsumov Date: Sat, 3 Oct 2020 07:07:14 +0300 Subject: [PATCH] Add optional filtering to `listmaps` CCMD output --- src/g_dumpinfo.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/g_dumpinfo.cpp b/src/g_dumpinfo.cpp index 358593583a..6cdcc593bc 100644 --- a/src/g_dumpinfo.cpp +++ b/src/g_dumpinfo.cpp @@ -367,8 +367,14 @@ CCMD(listmaps) if (map != NULL) { - Printf("%s: '%s' (%s)\n", info->MapName.GetChars(), info->LookupLevelName().GetChars(), - fileSystem.GetResourceFileName(fileSystem.GetFileContainer(map->lumpnum))); + if (argv.argc() == 1 + || CheckWildcards(argv[1], info->MapName.GetChars()) + || CheckWildcards(argv[1], info->LookupLevelName().GetChars()) + || CheckWildcards(argv[1], fileSystem.GetResourceFileName(fileSystem.GetFileContainer(map->lumpnum)))) + { + Printf("%s: '%s' (%s)\n", info->MapName.GetChars(), info->LookupLevelName().GetChars(), + fileSystem.GetResourceFileName(fileSystem.GetFileContainer(map->lumpnum))); + } delete map; } } @@ -405,4 +411,3 @@ CCMD(listsnapshots) } } } -