本文整理汇总了C#中ConsoleService.ParseCommandList方法的典型用法代码示例。如果您正苦于以下问题:C# ConsoleService.ParseCommandList方法的具体用法?C# ConsoleService.ParseCommandList怎么用?C# ConsoleService.ParseCommandList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConsoleService
的用法示例。
在下文中一共展示了ConsoleService.ParseCommandList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateVersionResource
static int GenerateVersionResource(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[targetFileName]", ConsoleService.Prompt, "Target Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("OUT", ConsoleService.Prompt, "Dst Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("PRODUCT"),
new ConsoleParam("RC"),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
string targetFilename = vl.DefaultParam.StrValue;
string outFilename = vl["OUT"].StrValue;
string product_name = vl["PRODUCT"].StrValue;
Win32BuildUtil.GenerateVersionInfoResource(targetFilename, outFilename, vl["RC"].StrValue, product_name);
return 0;
}
示例2: GenerateVpnWebOcxCab
static int GenerateVpnWebOcxCab(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[src]", ConsoleService.Prompt, "Src Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("DEST", ConsoleService.Prompt, "Dst Filename: ", ConsoleService.EvalNotEmpty, null),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
#if !BU_OSS
string destFileName = vl["DEST"].StrValue;
string srcFileName = vl.DefaultParam.StrValue;
Win32BuildUtil.GenerateVpnWebOcxCab(destFileName, srcFileName);
#endif
return 0;
}
示例3: Count
static int Count(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[DIR]", null, null, null, null),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
string dir = vl.DefaultParam.StrValue;
if (Str.IsEmptyStr(dir))
{
dir = Paths.BaseDirName;
}
string[] files = Directory.GetFiles(dir, "*", SearchOption.AllDirectories);
int numLines = 0;
int numBytes = 0;
int numComments = 0;
int totalLetters = 0;
Dictionary<string, int> commentsDict = new Dictionary<string, int>();
foreach (string file in files)
{
string ext = Path.GetExtension(file);
if (Str.StrCmpi(ext, ".c") || Str.StrCmpi(ext, ".cpp") || Str.StrCmpi(ext, ".h") ||
Str.StrCmpi(ext, ".rc") || Str.StrCmpi(ext, ".stb") || Str.StrCmpi(ext, ".cs")
|| Str.StrCmpi(ext, ".fx") || Str.StrCmpi(ext, ".hlsl"))
{
if (Str.InStr(file, "\\.svn\\") == false && Str.InStr(file, "\\seedll\\") == false && Str.InStr(file, "\\see\\") == false && Str.InStr(file, "\\openssl\\") == false)
{
string[] lines = File.ReadAllLines(file);
numLines += lines.Length;
numBytes += (int)new FileInfo(file).Length;
foreach (string line in lines)
{
if (Str.InStr(line, "//") && Str.InStr(line, "// Validate arguments") == false)
{
if (commentsDict.ContainsKey(line) == false)
{
commentsDict.Add(line, 1);
}
numComments++;
totalLetters += line.Trim().Length - 3;
}
}
}
}
}
Con.WriteLine("{0} Lines, {1} Bytes. {2} Comments ({3} distinct, aver: {4})", Str.ToStr3(numLines), Str.ToStr3(numBytes),
Str.ToStr3(numComments), commentsDict.Count, totalLetters / numComments);
return 0;
}
示例4: FileCopy
static int FileCopy(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[src]", ConsoleService.Prompt, "Src Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("DEST", ConsoleService.Prompt, "Dst Filename: ", ConsoleService.EvalNotEmpty, null),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
string destFileName = vl["DEST"].StrValue;
string srcFileName = vl.DefaultParam.StrValue;
IO.FileCopy(srcFileName, destFileName, true, false);
return 0;
}
示例5: SetManifest
static int SetManifest(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[filename]", ConsoleService.Prompt, "Target Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("MANIFEST", ConsoleService.Prompt, "Manifest Filename: ", ConsoleService.EvalNotEmpty, null),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
PEUtil.SetManifest(vl.DefaultParam.StrValue, vl["MANIFEST"].StrValue);
return 0;
}
示例6: CopyUnixSrc
static int CopyUnixSrc(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[destdir]", ConsoleService.Prompt, "Destination directory : ", ConsoleService.EvalNotEmpty, null),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
((BuildSoftwareUnix)BuildSoftwareList.vpnbridge_linux_x86_ja).CopyUnixSrc(vl.DefaultParam.StrValue);
return 0;
}
示例7: BuildHamCore
static int BuildHamCore(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
HamCoreBuildUtil.BuildHamcore();
return 0;
}
示例8: PostBuild
static int PostBuild(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
Win32BuildUtil.SignAllBinaryFiles();
HamCoreBuildUtil.BuildHamcore();
return 0;
}
示例9: MakeSoftEtherDir
static int MakeSoftEtherDir(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
OpenSourceUtil.MakeSoftEtherDir();
return 0;
}
示例10: All
static int All(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
#if !BU_SOFTETHER
new ConsoleParam("[yes|no]", ConsoleService.Prompt, "Increments build number (y/n) ? ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("SEVPN", ConsoleService.Prompt, "Build SoftEther VPN automatically after PacketiX VPN Build (y/n) ? ", ConsoleService.EvalNotEmpty, null),
#else
new ConsoleParam("[yes|no]"),
#endif
new ConsoleParam("IGNOREERROR"),
new ConsoleParam("DEBUG"),
new ConsoleParam("SERIAL"),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
DateTime start = Time.NowDateTime;
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:BuildWin32 {0} /NORMALIZESRC:{1}",
vl["[yes|no]"].BoolValue ? "yes" : "no",
"yes"));
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:ReleaseWin32 all /IGNOREERROR:{0} /SERIAL:{1}",
vl["IGNOREERROR"].BoolValue ? "yes" : "no",
vl["SERIAL"].BoolValue ? "yes" : "no"));
#if !BU_OSS
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:ReleaseUnix all /IGNOREERROR:{0} /DEBUG:{1} /SERIAL:{2}",
vl["IGNOREERROR"].BoolValue ? "yes" : "no",
vl["DEBUG"].BoolValue ? "yes" : "no",
vl["SERIAL"].BoolValue ? "yes" : "no"));
#endif
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:CopyRelease"));
#if !BU_SOFTETHER
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:MakeSoftEtherDir"));
if (vl["SEVPN"].BoolValue)
{
// Build SEVPN
Win32BuildUtil.ExecCommand(Paths.CmdFileName, string.Format("/C \"{0}\"", Path.Combine(Paths.SoftEtherBuildDir, @"Main\BuildAll.cmd")));
}
Win32BuildUtil.ExecCommand(Env.ExeFileName, string.Format("/CMD:MakeOpenSource"));
#endif
DateTime end = Time.NowDateTime;
Con.WriteLine("Taken time: {0}.", (end - start));
return 0;
}
示例11: Test
static int Test(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
TestClass.Test();
return 0;
}
示例12: SignCode
static int SignCode(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[filename]", ConsoleService.Prompt, "Filename: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("DEST"),
new ConsoleParam("COMMENT", ConsoleService.Prompt, "Comment: ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("KERNEL"),
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
string destFileName = vl["DEST"].StrValue;
string srcFileName = vl.DefaultParam.StrValue;
if (Str.IsEmptyStr(destFileName))
{
destFileName = srcFileName;
}
string comment = vl["COMMENT"].StrValue;
bool kernel = vl["KERNEL"].BoolValue;
CodeSign.SignFile(destFileName, srcFileName, comment, kernel);
return 0;
}
示例13: SetPE4
static int SetPE4(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[filename]", ConsoleService.Prompt, "Filename: ", ConsoleService.EvalNotEmpty, null)
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
PEUtil.SetPEVersionTo4(vl.DefaultParam.StrValue);
return 0;
}
示例14: GenerateWin8InfFiles
static int GenerateWin8InfFiles(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[cpu]", ConsoleService.Prompt, "x86 / x64: ", ConsoleService.EvalNotEmpty, null)
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
#if !BU_OSS
Win32BuildUtil.GenerateINFFilesForWindows8(vl.DefaultParam.StrValue);
#endif
return 0;
}
示例15: BuildWin32
static int BuildWin32(ConsoleService c, string cmdName, string str)
{
ConsoleParam[] args =
{
new ConsoleParam("[yes|no]", ConsoleService.Prompt, "Increments build number (y/n) ? ", ConsoleService.EvalNotEmpty, null),
new ConsoleParam("NORMALIZESRC", ConsoleService.Prompt, "Normalizes source codes (y/n) ? ", ConsoleService.EvalNotEmpty, null)
};
ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args);
if (vl.DefaultParam.BoolValue)
{
Win32BuildUtil.IncrementBuildNumber();
}
if (vl.DefaultParam.BoolValue || vl["NORMALIZESRC"].BoolValue)
{
Win32BuildUtil.NormalizeBuildInfo();
}
Paths.DeleteAllReleaseTarGz();
Paths.DeleteAllReleaseExe();
Paths.DeleteAllReleaseManuals();
Paths.DeleteAllReleaseAdminKits();
Win32BuildUtil.BuildMain();
Win32BuildUtil.SignAllBinaryFiles();
HamCoreBuildUtil.BuildHamcore();
Win32BuildUtil.CopyDebugSnapshot();
return 0;
}