Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Fix #169 - Fix broken keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jibedoubleve committed Dec 6, 2021
1 parent ef0f592 commit 7461541
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Probel.Lanceur.Core/Entities/Query.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Probel.Lanceur.Core.Services;
using System;
using System.Text.RegularExpressions;

namespace Probel.Lanceur.Core.Entities
{
Expand Down Expand Up @@ -121,12 +122,12 @@ public void SetParameters(string cmdline)
if (string.IsNullOrEmpty(cmdline)) { throw new ArgumentException($"The command line should NOT be empty or null", nameof(cmdline)); }

var (_, @params) = Split(cmdline);
var regex = new Regex("^[a-zA-Z0-9]{1,}");

Parameters = string.IsNullOrEmpty(@params)
Parameters = string.IsNullOrEmpty(@params) && !regex.IsMatch(Name.Trim())
? cmdline.Replace(Name.Trim(), "")
: @params;
}

}
public override string ToString() => $"{(Name ?? string.Empty)} {Parameters}";

#endregion Methods
Expand Down

0 comments on commit 7461541

Please sign in to comment.