Skip to content

Commit

Permalink
Fix --show-examples command
Browse files Browse the repository at this point in the history
  • Loading branch information
iomoath committed Aug 29, 2021
1 parent b646953 commit 3d015b7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ServiceLayer/CIM/Common/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class Commands
public static string GetCommandNameSpace(string command)
{
if (string.IsNullOrEmpty(command))
throw new ArgumentNullException(nameof(command));
return DefaultNameSpace;


if (CommandNameSpace.ContainsKey(command))
Expand Down
6 changes: 5 additions & 1 deletion ServiceLayer/CommonPublic/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ public static void GetExamples(bool isGui = false)

var c = commandSplit[0].Trim().TrimEnd().TrimStart();
var d = commandSplit[1].Trim().TrimEnd().TrimStart();
var example = commandSplit[2].Trim().TrimEnd().TrimStart();

var example = string.Empty;

if(commandSplit.Length > 2)
example = commandSplit[2].Trim().TrimEnd().TrimStart();

if (isGui)
{
Expand Down
6 changes: 5 additions & 1 deletion SharpStrikeConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private static void Main(string[] args)
{
try
{
args = new [] { "--show-examples" };
Init();
PrintAbout();
HandleCommand(args).Wait();
Expand Down Expand Up @@ -114,6 +115,7 @@ private static async Task HandleCommand(string[] args)
Messenger.Info(@"Execution time: " + watch.ElapsedMilliseconds / 1000 + @" Seconds");

Unlock();
Environment.Exit(1);
}
}

Expand Down Expand Up @@ -146,7 +148,9 @@ private static CommanderOptions ParseUserOptions(string[] args)
options.Domain = null;
options.Password = null;
}




options.NameSpace = Commands.GetCommandNameSpace(options.Command);

return options;
Expand Down
4 changes: 2 additions & 2 deletions SharpStrikeConsole/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
4 changes: 2 additions & 2 deletions SharpStrikeWinForms/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

0 comments on commit 3d015b7

Please sign in to comment.