Skip to content

Commit

Permalink
Added version option
Browse files Browse the repository at this point in the history
  • Loading branch information
enkomio committed Dec 31, 2017
1 parent 3ab08ac commit 88ecfb3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
12 changes: 6 additions & 6 deletions ES.Shed/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Shed")>]
[<assembly: AssemblyCompanyAttribute("Enkomio")>]
[<assembly: AssemblyDescriptionAttribute("A .NET runtime inspector.")>]
[<assembly: AssemblyVersionAttribute("1.0.0")>]
[<assembly: AssemblyFileVersionAttribute("1.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.0.0.*")>]
[<assembly: AssemblyVersionAttribute("1.1.0")>]
[<assembly: AssemblyFileVersionAttribute("1.1.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.1.0.*")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "ES.Shed"
let [<Literal>] AssemblyProduct = "Shed"
let [<Literal>] AssemblyCompany = "Enkomio"
let [<Literal>] AssemblyDescription = "A .NET runtime inspector."
let [<Literal>] AssemblyVersion = "1.0.0"
let [<Literal>] AssemblyFileVersion = "1.0.0"
let [<Literal>] AssemblyInformationalVersion = "1.0.0.*"
let [<Literal>] AssemblyVersion = "1.1.0"
let [<Literal>] AssemblyFileVersion = "1.1.0"
let [<Literal>] AssemblyInformationalVersion = "1.1.0.*"
12 changes: 6 additions & 6 deletions Shed/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Shed")>]
[<assembly: AssemblyCompanyAttribute("Enkomio")>]
[<assembly: AssemblyDescriptionAttribute("A .NET runtime inspector.")>]
[<assembly: AssemblyVersionAttribute("1.0.0")>]
[<assembly: AssemblyFileVersionAttribute("1.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.0.0.*")>]
[<assembly: AssemblyVersionAttribute("1.1.0")>]
[<assembly: AssemblyFileVersionAttribute("1.1.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.1.0.*")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Shed"
let [<Literal>] AssemblyProduct = "Shed"
let [<Literal>] AssemblyCompany = "Enkomio"
let [<Literal>] AssemblyDescription = "A .NET runtime inspector."
let [<Literal>] AssemblyVersion = "1.0.0"
let [<Literal>] AssemblyFileVersion = "1.0.0"
let [<Literal>] AssemblyInformationalVersion = "1.0.0.*"
let [<Literal>] AssemblyVersion = "1.1.0"
let [<Literal>] AssemblyFileVersion = "1.1.0"
let [<Literal>] AssemblyInformationalVersion = "1.1.0.*"
10 changes: 10 additions & 0 deletions Shed/Program.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Shed

open System
open System.Reflection
open System.Threading
open System.IO
open System.Diagnostics
Expand All @@ -14,6 +15,7 @@ module Program =
| Pid of pid:Int32
| Exe of file:String
| Timeout of timeout:Int32
| Version
| Verbose
with
interface IArgParserTemplate with
Expand All @@ -25,6 +27,7 @@ module Program =
| Exe _ -> "a filename to execute and inspect."
| Timeout _ -> "wait the given amount of milliseconds before to inspect the process. This is only valid if an exe is specified."
| Verbose _ -> "print verbose messages."
| Version _ -> "print the Shed version."

let printBanner() =
Console.ForegroundColor <- ConsoleColor.Cyan
Expand All @@ -42,6 +45,10 @@ module Program =
Console.ForegroundColor <- ConsoleColor.Red
Console.WriteLine(errorMsg)
Console.ResetColor()

let printVersion() =
let version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion
Console.WriteLine("Shed version: {0}", version)

let runFramework(pid: Int32, results: ParseResults<CLIArguments>) =
let dumpModules = results.Contains(<@ Dump_Modules @>)
Expand Down Expand Up @@ -86,6 +93,9 @@ module Program =
if results.IsUsageRequested then
printUsage(parser.PrintUsage())
0
elif results.Contains(<@ Version @>) then
printVersion()
0
else
match results.TryGetResult(<@ Pid @>), results.TryGetResult(<@ Exe @>) with
| (None, None)
Expand Down

0 comments on commit 88ecfb3

Please sign in to comment.