/// <summary> /// Auto-generated argument string /// </summary> public string GetArgsString() { var ops = new List <string>(); foreach (FieldInfo item in this.GetType().GetFields()) { var atts = item.CustomAttributes; bool hasIt = atts.ToList().Exists(n => n.AttributeType == typeof(OptionAttribute)); if (hasIt) { string optionName = item.Name; string value = (string)item.GetValue(this); string surroundedValue = StringModifier.SurroundWith("\"", value); string op = $"-{optionName}:{surroundedValue}"; ops.Add(op); } } string cmd = string.Join(" ", ops); return(cmd); }
/// <summary> /// Exe file path surrounded by " charater /// </summary> public string GetExePath() { return(StringModifier.SurroundWith("\"", _exePath)); }