Innovenergy_trunk/csharp/Lib/SysTools/Edges/StringToCommand.cs

56 lines
1.3 KiB
C#
Raw Normal View History

namespace InnovEnergy.Lib.SysTools.Edges;
2023-02-16 12:57:06 +00:00
public static class StringToCommand
{
public static SysCommand ToCommand(this String cmd) => new SysCommand(cmd);
public static SysCommand Opt1(this String cmd, String option)
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt1(option);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Opt1(this String cmd, String option, Object value, String separator = " ")
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt1(option, value, separator);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Opt2(this String cmd, String option)
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt2(option);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Opt2(this String cmd, String option, Object value, String separator = "=")
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt2(option, value, separator);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Opt(this String cmd, String option)
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt(option);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Opt(this String cmd, String option, Object value)
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Opt(option, value);
2023-02-16 12:57:06 +00:00
}
public static SysCommand Arg(this String cmd, Object argument)
{
return cmd
2023-02-25 15:16:12 +00:00
.ToCommand()
.Arg(argument);
2023-02-16 12:57:06 +00:00
}
}