source: branches/2924_DotNetCoreMigration/HeuristicLab/3.3/InspectCommand.cs @ 17039

Last change on this file since 17039 was 17039, checked in by dpiringe, 2 years ago

#2924:

  • removed a blank line in InspectCommand.cs
  • removed BuildCommand.cs and project HeuristicLab.DefinitionLanguage, because it was only a test
  • removed reference BuildCommand in ApplicationCommand
File size: 873 bytes
Line 
1using System.IO;
2using System.Linq;
3using HeuristicLab.CommandLineInterface;
4using HeuristicLab.PluginInfrastructure;
5
6namespace HeuristicLab {
7  [Command(Description = "To inspect a .hl file.")]
8  class InspectCommand : ICommand {
9
10    [Value(0)]
11    public string Input { get; set; }
12
13    public void Execute() {
14      if (Input == null || !File.Exists(Input))
15        throw new FileNotFoundException("Path to .hl file empty or wrong!");
16
17      if (Settings.Host != null) {
18        Settings.Host.QuietMode = false;
19        Settings.Host.Run(new ApplicationRunner() {
20          AssembliesToLoad = Settings.assemblyInfos,
21          StartApplication =
22            ApplicationManager.Manager.GetInstances<IApplication>(new UniPath(Input))
23            .Where(x => x.Name.Equals("CLIInspect"))
24            .First()
25        });
26      }
27    }
28  }
29}
Note: See TracBrowser for help on using the repository browser.