using System.IO; using System.Linq; using HeuristicLab.CommandLineInterface; using HeuristicLab.PluginInfrastructure; namespace HeuristicLab { [Command(Description = "To inspect a .hl file.")] class InspectCommand : ICommand { [Value(0)] public string Input { get; set; } public void Execute() { if (Input == null || !File.Exists(Input)) throw new FileNotFoundException("Path to .hl file empty or wrong!"); if (Settings.Host != null) { Settings.Host.QuietMode = false; Settings.Host.Run(new ApplicationRunner() { AssembliesToLoad = Settings.assemblyInfos, StartApplication = ApplicationManager.Manager.GetInstances(new UniPath(Input)) .Where(x => x.Name.Equals("CLIInspect")) .First() }); } } } }