Skip to content

Commit 7d3b8c8

Browse files
authored
Merge pull request #20 from blaho/master
added cleanup.list command
2 parents e588184 + ea9b7d9 commit 7d3b8c8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Essentials/Commands/CleanupModule.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ public void Scan()
1919
Context.Respond($"Found {count} grids matching the given conditions.");
2020
}
2121

22+
[Command("list", "Lists grids matching the given conditions: hastype, notype, hassubtype, nosubtype, blockslessthan, blocksgreaterthan, ownedby")]
23+
public void List()
24+
{
25+
var grids = ScanConditions(Context.Args).OrderBy(g => g.DisplayName).ToList();
26+
Context.Respond(String.Join("\n", grids.Select((g, i) => $"{i + 1}. {grids[i].DisplayName} ({grids[i].BlocksCount} block(s))")));
27+
Context.Respond($"Found {grids.Count} grids matching the given conditions.");
28+
}
29+
2230
[Command("delete", "Delete grids matching the given conditions")]
2331
public void Delete()
2432
{

0 commit comments

Comments
 (0)