mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
[CLI] Refactor
This commit is contained in:
parent
74a8555514
commit
4e41caf203
@ -55,14 +55,6 @@ namespace AssetStudioCLI.Options
|
|||||||
NameAndContainer,
|
NameAndContainer,
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class GroupedOption<T> : Option<T>
|
|
||||||
{
|
|
||||||
internal GroupedOption(T optionDefaultValue, string optionName, string optionDescription, HelpGroups optionHelpGroup, bool isFlag = false) : base(optionDefaultValue, optionName, optionDescription, optionHelpGroup, isFlag)
|
|
||||||
{
|
|
||||||
CLIOptions._OptionGrouping(optionName, optionDescription, optionHelpGroup, isFlag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static class CLIOptions
|
internal static class CLIOptions
|
||||||
{
|
{
|
||||||
public static bool isParsed;
|
public static bool isParsed;
|
||||||
@ -99,10 +91,11 @@ namespace AssetStudioCLI.Options
|
|||||||
|
|
||||||
static CLIOptions()
|
static CLIOptions()
|
||||||
{
|
{
|
||||||
|
OptionExtensions.OptionGrouping = OptionGrouping;
|
||||||
InitOptions();
|
InitOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void _OptionGrouping(string name, string desc, HelpGroups group, bool isFlag) //TODO
|
private static void OptionGrouping(string name, string desc, HelpGroups group, bool isFlag)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(name))
|
if (string.IsNullOrEmpty(name))
|
||||||
{
|
{
|
||||||
@ -828,7 +821,7 @@ namespace AssetStudioCLI.Options
|
|||||||
sb.AppendLine(ShowCurrentFilter());
|
sb.AppendLine(ShowCurrentFilter());
|
||||||
sb.AppendLine($"# Assebmly Path: \"{o_assemblyPath}\"");
|
sb.AppendLine($"# Assebmly Path: \"{o_assemblyPath}\"");
|
||||||
sb.AppendLine($"# Unity Version: \"{o_unityVersion}\"");
|
sb.AppendLine($"# Unity Version: \"{o_unityVersion}\"");
|
||||||
sb.AppendLine($"# Restore TextAsset extension: {!f_notRestoreExtensionName.Value}");
|
sb.AppendLine($"# Restore TextAsset Extension: {!f_notRestoreExtensionName.Value}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sb.AppendLine("======");
|
sb.AppendLine("======");
|
||||||
|
17
AssetStudioCLI/Options/OptionExtensions.cs
Normal file
17
AssetStudioCLI/Options/OptionExtensions.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace AssetStudioCLI.Options
|
||||||
|
{
|
||||||
|
internal static class OptionExtensions
|
||||||
|
{
|
||||||
|
public static Action<string, string, HelpGroups, bool> OptionGrouping = (name, desc, group, isFlag) => { };
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class GroupedOption<T> : Option<T>
|
||||||
|
{
|
||||||
|
public GroupedOption(T optionDefaultValue, string optionName, string optionDescription, HelpGroups optionHelpGroup, bool isFlag = false) : base(optionDefaultValue, optionName, optionDescription, optionHelpGroup, isFlag)
|
||||||
|
{
|
||||||
|
OptionExtensions.OptionGrouping(optionName, optionDescription, optionHelpGroup, isFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user