mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Moved MewExplorer to a new repo
This commit is contained in:
33
MewTerminal/Commands/ListSupportCommand.cs
Normal file
33
MewTerminal/Commands/ListSupportCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CommandLine;
|
||||
using MewtocolNet;
|
||||
using MewtocolNet.ComCassette;
|
||||
using MewtocolNet.Logging;
|
||||
using Spectre.Console;
|
||||
|
||||
namespace MewTerminal.Commands;
|
||||
|
||||
[Verb("support-list", HelpText = "Lists all supported PLC types")]
|
||||
internal class ListSupportCommand : CommandLineExcecuteable {
|
||||
|
||||
public override void Run () {
|
||||
|
||||
var plcs = Enum.GetValues<PlcType>().Cast<PlcType>();
|
||||
|
||||
var lst = new List<ParsedPlcName>();
|
||||
|
||||
foreach (var plcT in plcs) {
|
||||
|
||||
var decomp = plcT.ToNameDecompose();
|
||||
|
||||
foreach (var name in decomp)
|
||||
lst.Add(name);
|
||||
|
||||
}
|
||||
|
||||
AnsiConsole.Write(lst.ToTable());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user