Skip to content

Commit b95b6f6

Browse files
committed
Display additional info as part of version info
1 parent bc4181c commit b95b6f6

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Dotnet.Script/Program.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,11 @@ private static int Wain(string[] args)
7272

7373
app.VersionOption("-v | --version", GetVersionInfo);
7474

75-
app.VersionOption("-i | --info", GetInfo);
76-
7775
app.Command("eval", c =>
7876
{
7977
c.Description = "Execute CSX code.";
8078
var code = c.Argument("code", "Code to execute.");
81-
var cwd = c.Option("-cwd |--workingdirectory <currentworkingdirectory>", "Working directory for the code compiler. Defaults to current directory.", CommandOptionType.SingleValue);
82-
79+
var cwd = c.Option("-cwd |--workingdirectory <currentworkingdirectory>", "Working directory for the code compiler. Defaults to current directory.", CommandOptionType.SingleValue);
8380
c.OnExecute(async () =>
8481
{
8582
int exitCode = 0;
@@ -210,8 +207,16 @@ private static Task<int> Run(bool debugMode, ScriptContext context)
210207

211208
private static string GetVersionInfo()
212209
{
213-
var versionAttribute = typeof(Program).GetTypeInfo().Assembly.GetCustomAttributes<AssemblyInformationalVersionAttribute>().SingleOrDefault();
214-
return versionAttribute?.InformationalVersion;
210+
StringBuilder sb = new StringBuilder();
211+
var versionAttribute = typeof(Program).GetTypeInfo().Assembly.GetCustomAttributes<AssemblyInformationalVersionAttribute>().SingleOrDefault();
212+
sb.AppendLine($"Version : {versionAttribute?.InformationalVersion}");
213+
sb.AppendLine($"Install location : {RuntimeHelper.InstallLocation}");
214+
sb.AppendLine($"Target framework : {RuntimeHelper.TargetFramework}");
215+
sb.AppendLine($"Platform identifier : {RuntimeHelper.GetPlatformIdentifier()}");
216+
sb.AppendLine($"Runtime identifier : {RuntimeHelper.GetRuntimeIdentifier()}");
217+
return sb.ToString();
218+
219+
215220
}
216221

217222
private static string GetInfo()

0 commit comments

Comments
 (0)