From 280951089e96a3f70b13fcdf93d12c11757d42d7 Mon Sep 17 00:00:00 2001 From: v-alexjo Date: Fri, 15 Jan 2016 17:37:42 -0800 Subject: [PATCH] Added help file for the command line --- src/Microsoft.PowerShell.Linux.Host/main.cs | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Microsoft.PowerShell.Linux.Host/main.cs b/src/Microsoft.PowerShell.Linux.Host/main.cs index 9ff281c0f8..30d82380b3 100644 --- a/src/Microsoft.PowerShell.Linux.Host/main.cs +++ b/src/Microsoft.PowerShell.Linux.Host/main.cs @@ -175,6 +175,41 @@ namespace Microsoft.PowerShell.Linux.Host this.currentPowerShell = PowerShell.Create(); } + + if (initialScript == "--help" || initialScript == "-h") + { + Console.WriteLine(@" +======HELP====== +PowerShell for Linux +Command Line Help Resource +================ + +TOPIC + PowerShell for Linux Command Line Arguments + +SYNOPSIS + PowerShell for Linux takes several command line arguments. + +OPTIONS + + [NO ARGUMENTS] Will launch PowerShell for Linux in an interactive shell. + + --command Will execute given string as a PowerShell command. + + -c Will execute given string as a PowerShell command. + + --file Given a file path will execute as a PowerShell script. + + -f Given a file path will execute as a PowerShell script. + + --help Prints a basic help of command line arguments for PowerShell on Linux + + -h Prints a basic help of command line arguments for PowerShell on Linux. + +"); + return; + } + try { this.currentPowerShell.Runspace = this.myRunSpace;