Esempio n. 1
0
 public new OptionDescription[] GetOptionDescription()
 {
     return(((IEnumerable <OptionDescription>) new OptionDescription[14]
     {
         new OptionDescription("--type", (string)null, 1, (Action <List <string> >)(s =>
         {
             this.isUseAdf = false;
             this.isTypeSpecified = true;
             try
             {
                 Enum.Parse(typeof(ContentMetaType), s.First <string>());
             }
             catch (Exception ex)
             {
                 throw new InvalidOptionException(string.Format("invalid option --type {0}.", (object)s.First <string>()));
             }
             this.NspContentInfos[this.contentInfoIndex].MetaType = s.First <string>();
         })),
         OptionUtil.CreateFilePathOptionDescription("--meta", (OptionUtil.PathSetter)(path =>
         {
             this.isUseAdf = false;
             this.isMetaSpecified = true;
             this.NspContentInfos[this.contentInfoIndex].MetaFilePath = path;
         })),
         OptionUtil.CreateFilePathOptionDescription("--desc", (OptionUtil.PathSetter)(path =>
         {
             this.isUseAdf = false;
             this.NspContentInfos[this.contentInfoIndex].DescFilePath = path;
         })),
         new OptionDescription("--keyindex", (string)null, 1, (Action <List <string> >)(s => this.NspContentInfos[this.contentInfoIndex].KeyAreaEncryptionKeyIndex = int.Parse(s.First <string>()))),
         this.CreateContentOptionDescription("--program", "Program", 3),
         this.CreateContentOptionDescription("--control", "Control", 1),
         this.CreateContentOptionDescriptionForHtmlDocument("--html-document", "html-document"),
         this.CreateContentOptionDescriptionForHtmlDocument("--accessible-urls", "accessible-urls"),
         this.CreateContentOptionDescription("--legal-information", "LegalInformation", 1),
         this.CreateContentOptionDescription("--legal-information-dir", "LegalInformation", 1),
         this.CreateContentOptionDescription("--data", "Data", 1),
         new OptionDescription("--icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--icon <language> <iconPath>...");
             }
             this.NspContentInfos[this.contentInfoIndex].IconList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--nx-icon <language> <iconPath>...");
             }
             this.NspContentInfos[this.contentInfoIndex].NxIconList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon-max-size", (string)null, 32, (Action <List <string> >)(s => this.NspContentInfos[this.contentInfoIndex].NxIconMaxSize = Convert.ToUInt32(s.First <string>())))
     }).Concat <OptionDescription>((IEnumerable <OptionDescription>)base.GetOptionDescription()).ToArray <OptionDescription>());
 }
Esempio n. 2
0
 public void ParsePositionalArgument(string[] args)
 {
     if (args.Length < 2)
     {
         throw new InvalidOptionException("too few arguments for mergensp subcommand.");
     }
     for (int index = 0; index < args.Length; ++index)
     {
         this.InputFiles.Add(OptionUtil.CheckAndNormalizeFilePath(args[index], string.Format("arg[{0}]", (object)index)));
     }
 }
Esempio n. 3
0
 public new OptionDescription[] GetOptionDescription()
 {
     return(((IEnumerable <OptionDescription>) new OptionDescription[10]
     {
         OptionUtil.CreateFilePathOptionDescription("--meta", (OptionUtil.PathSetter)(path => this.MetaFilePath = path)),
         OptionUtil.CreateFilePathOptionDescription("--desc", (OptionUtil.PathSetter)(path => this.DescFilePath = path)),
         this.CreateContentOptionDescription("--program", "Program", 3),
         this.CreateContentOptionDescription("--control", "Control", 1),
         this.CreateContentOptionDescriptionForHtmlDocument("--html-document", "html-document"),
         this.CreateContentOptionDescriptionForHtmlDocument("--accessible-urls", "accessible-urls"),
         this.CreateContentOptionDescription("--legal-information", "LegalInformation", 1),
         this.CreateContentOptionDescription("--legal-information-dir", "LegalInformation", 1),
         this.CreateContentOptionDescription("--data", "Data", 1),
         new OptionDescription("--keyindex", (string)null, 1, (Action <List <string> >)(s => this.KeyAreaEncryptionKeyIndex = int.Parse(s.First <string>())))
     }).Concat <OptionDescription>((IEnumerable <OptionDescription>)base.GetOptionDescription()).ToArray <OptionDescription>());
 }
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[7]
     {
         new OptionDescription((string)null, "-o", 1, (Action <List <string> >)(s => this.OutputDirectory = OptionUtil.GetOutputFilePath(this.OutputDirectory, s.First <string>()))),
         new OptionDescription("--gamecard", (string)null, 0, (Action <List <string> >)(s =>
         {
             this.CreateXci = true;
             this.CreateXcie = true;
         })),
         new OptionDescription("--no-xcie", (string)null, 0, (Action <List <string> >)(s => this.NoCreateXcie = true)),
         new OptionDescription("--auto-boot", (string)null, 0, (Action <List <string> >)(s => this.LaunchFlags |= (byte)1)),
         new OptionDescription("--history-erase", (string)null, 0, (Action <List <string> >)(s => this.LaunchFlags |= (byte)2)),
         OptionUtil.CreateFilePathOptionDescription("--upp", (OptionUtil.PathSetter)(path => this.InputUppNspFile = path)),
         OptionUtil.CreateFilePathOptionDescription("--patch", (OptionUtil.PathSetter)(path => this.InputPatchNspFile = path))
     });
 }
 public void ParsePositionalArgument(string[] args)
 {
     if (args.Length == 0)
     {
         throw new InvalidOptionException("input nsp file must be specified for prodencryption subcommand.");
     }
     this.InputNspFile = OptionUtil.CheckAndNormalizeFilePath(args[0], "arg[0]");
     if (args.Length >= 2)
     {
         throw new InvalidOptionException("too many arguments for prodencryption subcommand.");
     }
     if (!this.CreateXci && (this.NoCreateXcie || this.LaunchFlags != (byte)0 || (this.InputUppNspFile != null || this.InputPatchNspFile != null)))
     {
         throw new InvalidOptionException("--no-xcie, --auto-boot, --history-erase, --upp and --patch option requires to be used with --xci option.");
     }
     if (!this.NoCreateXcie)
     {
         return;
     }
     this.CreateXcie = false;
 }
Esempio n. 6
0
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[6]
     {
         new OptionDescription((string)null, "-o", 1, (Action <List <string> >)(s => this.OutputDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()))),
         new OptionDescription("--type", (string)null, 1, (Action <List <string> >)(s =>
         {
             try
             {
                 Enum.Parse(typeof(Nintendo.Authoring.AuthoringTool.ContentMetaType), s.First <string>());
             }
             catch (Exception ex)
             {
                 throw new InvalidOptionException(string.Format("invalid option --type {0}.", (object)s.First <string>()));
             }
             this.MetaType = s.First <string>();
         })),
         OptionUtil.CreateFilePathOptionDescription("--meta", (OptionUtil.PathSetter)(path => this.MetaFilePath = path)),
         new OptionDescription("--icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--icon <language> <iconPath>...");
             }
             this.IconFileList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--nx-icon <language> <iconPath>...");
             }
             this.NxIconFileList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon-max-size", (string)null, 32, (Action <List <string> >)(s => this.NxIconMaxSize = Convert.ToUInt32(s.First <string>())))
     });
 }
Esempio n. 7
0
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[4]
     {
         new OptionDescription("--help", "-h", 0, (Action <List <string> >)(s => this.IsShowUsage = true)),
         new OptionDescription("--verbose", "-v", 0, (Action <List <string> >)(s => this.IsVerbose = true)),
         new OptionDescription("--keyconfig", (string)null, 1, (Action <List <string> >)(s => this.Config.KeyConfigFilePath = OptionUtil.GetOutputFilePath(string.Empty, s.First <string>()))),
         new OptionDescription("--includes-cnmt", (string)null, 0, (Action <List <string> >)(s => this.Config.DebugConfig.EnableContentMetaBinaryExport = true))
     });
 }
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[4]
     {
         new OptionDescription((string)null, "-o", 1, (Action <List <string> >)(s => this.OutputFile = OptionUtil.GetOutputFilePath(this.OutputFile, s.First <string>()))),
         new OptionDescription("--filter", (string)null, 1, (Action <List <string> >)(s => this.InputFdfPath = s.First <string>())),
         new OptionDescription("--save-adf", (string)null, 0, (Action <List <string> >)(s => this.IsSaveAdf = true)),
         new OptionDescription("--only-adf", (string)null, 0, (Action <List <string> >)(s => this.IsOnlyAdf = true))
     });
 }
Esempio n. 9
0
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[14]
     {
         new OptionDescription((string)null, "-o", 1, (Action <List <string> >)(s => this.OutputDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()).TrimEnd('/'))),
         new OptionDescription("--type", (string)null, 1, (Action <List <string> >)(s =>
         {
             try
             {
                 Enum.Parse(typeof(Nintendo.Authoring.AuthoringTool.ContentMetaType), s.First <string>());
             }
             catch (Exception ex)
             {
                 throw new InvalidOptionException(string.Format("invalid option --type {0}.", (object)s.First <string>()));
             }
             this.MetaType = s.First <string>();
         })),
         OptionUtil.CreateFilePathOptionDescription("--meta", (OptionUtil.PathSetter)(path => this.MetaFilePath = path)),
         new OptionDescription("--program", (string)null, 3, (Action <List <string> >)(s =>
         {
             if (this.CodeDirectory != null)
             {
                 throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
             }
             this.CodeDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>());
             if (s.Count > 1)
             {
                 if (this.DataDirectory != null)
                 {
                     throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
                 }
                 this.DataDirectory = OptionUtil.GetOutputFilePath(".", s[1]);
             }
             if (s.Count <= 2)
             {
                 return;
             }
             if (this.LogoDirectory != null)
             {
                 throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
             }
             this.LogoDirectory = OptionUtil.GetOutputFilePath(".", s[2]);
         })),
         new OptionDescription("--code", (string)null, 1, (Action <List <string> >)(s =>
         {
             if (this.CodeDirectory != null)
             {
                 throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
             }
             this.CodeDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>());
         })),
         new OptionDescription("--data", (string)null, 1, (Action <List <string> >)(s =>
         {
             if (this.DataDirectory != null)
             {
                 throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
             }
             this.DataDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>());
         })),
         new OptionDescription("--logo", (string)null, 1, (Action <List <string> >)(s =>
         {
             if (this.LogoDirectory != null)
             {
                 throw new InvalidOptionException("--program option cannot be used with --code, --data and --logo options.");
             }
             this.LogoDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>());
         })),
         new OptionDescription("--control", (string)null, 1, (Action <List <string> >)(s => this.ControlDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()))),
         new OptionDescription("--html-document", (string)null, 1, (Action <List <string> >)(s => this.HtmlDocumentDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()))),
         new OptionDescription("--accessible-urls", (string)null, 1, (Action <List <string> >)(s => this.AccessibleUrlsDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()))),
         new OptionDescription("--legal-information-dir", (string)null, 1, (Action <List <string> >)(s => this.LegalInformationDirectory = OptionUtil.GetOutputFilePath(".", s.First <string>()))),
         new OptionDescription("--icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--icon <language> <iconPath>...");
             }
             this.IconFileList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon", (string)null, 32, (Action <List <string> >)(s =>
         {
             if (s.Count % 2 != 0)
             {
                 throw new InvalidOptionException("--nx-icon <language> <iconPath>...");
             }
             this.NxIconFileList = OptionUtil.CreateIconFileList(s);
         })),
         new OptionDescription("--nx-icon-max-size", (string)null, 32, (Action <List <string> >)(s => this.NxIconMaxSize = Convert.ToUInt32(s.First <string>())))
     });
 }
Esempio n. 10
0
 public OptionDescription[] GetOptionDescription()
 {
     return(new OptionDescription[1]
     {
         new OptionDescription((string)null, "-o", 1, (Action <List <string> >)(s => this.OutputDirectory = OptionUtil.GetOutputFilePath(this.OutputDirectory, s.First <string>())))
     });
 }
Esempio n. 11
0
 public static OptionDescription CreateFilePathOptionDescription(string longName, OptionUtil.PathSetter setter)
 {
     return(new OptionDescription(longName, (string)null, 1, (Action <List <string> >)(s => setter(OptionUtil.CheckAndNormalizeFilePath(s.First <string>(), longName)))));
 }