├── .gitattributes ├── .gitignore ├── .npmrc ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── AssemblyInfo.cs ├── AssemblyInfo.cs.meta ├── CommandLineArgumentAttribute.cs ├── CommandLineArgumentAttribute.cs.meta ├── CommandLineCommandAttribute.cs ├── CommandLineCommandAttribute.cs.meta ├── CommandLineParser.cs ├── CommandLineParser.cs.meta ├── Console.cs ├── Console.cs.meta ├── HelpTextGenerator.cs ├── HelpTextGenerator.cs.meta ├── UnityCommandLineParser.asmdef └── UnityCommandLineParser.asmdef.meta ├── package.json ├── package.json.meta ├── thirdpartycredits.txt └── thirdpartycredits.txt.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://upm-pkgs.voltstro.dev 2 | always-auth=true -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2022 Voltstro-Studios 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffa13efc6aef73448a76ae0b02c9260c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityCommandLineParser 2 | 3 | [![License](https://img.shields.io/github/license/Voltstro-Studios/UnityCommandLineParser.svg)](/LICENSE) 4 | [![Discord](https://img.shields.io/badge/Discord-Voltstro-7289da.svg?logo=discord)](https://discord.voltstro.dev) 5 | [![YouTube](https://img.shields.io/badge/Youtube-Voltstro-red.svg?logo=youtube)](https://www.youtube.com/Voltstro) 6 | 7 | A command line parser for Unity. 8 | 9 | One of the issues that plague most C# command line parsers is that they are designed to be run from `Program.Main(string[] args);` and basically take over as the entry point of your C# app. However, Unity doesn't have the standard C# entry point. So we created this project, a command line parser for Unity that is easy to use. 10 | 11 | This project uses [McMaster.Extensions.CommandLineUtils](https://github.com/natemcmaster/CommandLineUtils) as its underlying parsing library and provides attributes to mark fields that can be filled out by an argument. You can use any field type that [CommandLineUtils](https://github.com/natemcmaster/CommandLineUtils/blob/main/src/CommandLineUtils/Abstractions/ValueParserProvider.cs) supports by default. 12 | 13 | ## Features 14 | 15 | - Parses launch arguments when the player is launched. 16 | - Supports commands and arguments 17 | 18 | ## Getting Started 19 | 20 | ### Package Installation 21 | 22 | #### Prerequisites 23 | 24 | ``` 25 | Unity 2020.3.x 26 | ``` 27 | 28 | ### Installation Methods 29 | 30 | There are three main sources on how you can install this package. Pick which ever one suites you the best! 31 | 32 | #### Voltstro UPM 33 | 34 | You can install this package from our custom UPM registry. To setup our registry, see [here](https://github.com/Voltstro/VoltstroUPM#setup). 35 | 36 | Once you have the registry added to your project, you can install it like any other package via the package manager. 37 | 38 | #### OpenUPM 39 | 40 | You can install this package via [OpenUPM](https://openupm.com/). 41 | 42 | To install it, use their CLI: 43 | 44 | ```bash 45 | openupm-cli add dev.voltstro.unitycommandlineparser 46 | ``` 47 | 48 | #### Git 49 | 50 | To install it via the package manager with git you will need to: 51 | 52 | 1. Setup [UnityNuGet](https://github.com/xoofx/UnityNuGet#unitynuget-) 53 | 2. Open up the package manager via Windows **->** Package Manager 54 | 3. Click on the little + sign **->** Add package from git URL... 55 | 4. Type `https://github.com/Voltstro-Studios/UnityCommandLineParser.git` and add it 56 | 5. Unity will now download and install the package 57 | 58 | Please note that you will have to manually check for updates, and replace the hash (or tag version) in your project's `packages-lock.json` file. 59 | 60 | ### Usage 61 | 62 | Mark a static field with a `[CommandLineArgument]` attribute to be able to be set as a command line argument. 63 | 64 | Or you can mark a static method with a `[CommandLineCommand]` attribute to be able to run a method as a command line argument. 65 | 66 | #### Examples 67 | 68 | ```csharp 69 | [CommandLineArgument("name", "Sets the name of the player")] 70 | public static string Name = "Voltstro"; 71 | 72 | [CommandLineArgument("fps", "Sets the fps of the game.")] 73 | public static int Fps = 60; 74 | 75 | [CommandLineCommand("weapons", "Adds all default weapons to the player on load")] 76 | public static void AddDefaultWeapons() 77 | { 78 | //Do some cool stuff 79 | } 80 | ``` 81 | 82 | If this example was to be run with the commands: `./UnityPlayer -fps 420 -name "EternalClickbait Suxs" -weapons`, it would set the `Fps` variable to `420`, set the `Name` variable to `EternalClickbait Suxs` and run the method `AddDefaultWeapons()` on startup. 83 | 84 | ## Authors 85 | 86 | **Voltstro** - *Initial Work* - [Voltstro](https://github.com/Voltstro) 87 | 88 | ## License 89 | 90 | This project is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details. 91 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91d5a18568618b3498d8707d985940ca 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3c03afa95f464c478577c67d3ec1579 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Unity command line parser")] 8 | [assembly: AssemblyDescription("Command line parser for Unity")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Voltstro-Studios")] 11 | [assembly: AssemblyProduct("Unity Command Line Parser")] 12 | [assembly: AssemblyCopyright("Copyright © 2020-2022 Voltstro-Studios")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // Version information for an assembly consists of the following four values: 22 | // 23 | // Major Version 24 | // Minor Version 25 | // Build Number 26 | // Revision 27 | // 28 | // You can specify all the values or you can default the Build and Revision Numbers 29 | // by using the '*' as shown below: 30 | // [assembly: AssemblyVersion("1.0.*")] 31 | [assembly: AssemblyVersion("2.1.1")] 32 | [assembly: AssemblyFileVersion("2.1.1")] -------------------------------------------------------------------------------- /Runtime/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc6c4d6a687c4c09d9897db2698d36e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/CommandLineArgumentAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | 4 | namespace UnityCommandLineParser 5 | { 6 | /// 7 | /// An for making a static field be set when the supplied arguments is provided 8 | /// 9 | [AttributeUsage(AttributeTargets.Field)] 10 | [PublicAPI] 11 | public class CommandLineArgumentAttribute : Attribute 12 | { 13 | /// 14 | /// Marks a field to be set by the command line parser if the argument is supplied 15 | /// 16 | /// 17 | public CommandLineArgumentAttribute([NotNull] string name) 18 | { 19 | if (string.IsNullOrWhiteSpace(name)) 20 | throw new ArgumentNullException(nameof(name)); 21 | 22 | Name = name; 23 | Description = ""; 24 | } 25 | 26 | /// 27 | /// Marks a field to be set by the command line parser if the argument is supplied 28 | /// 29 | /// 30 | /// 31 | public CommandLineArgumentAttribute([NotNull] string name, [NotNull] string description) 32 | { 33 | if (string.IsNullOrWhiteSpace(name)) 34 | throw new ArgumentNullException(nameof(name)); 35 | 36 | if (string.IsNullOrWhiteSpace(description)) 37 | throw new ArgumentNullException(nameof(description)); 38 | 39 | Name = name; 40 | Description = description; 41 | } 42 | 43 | /// 44 | /// What argument this is using 45 | /// 46 | public string Name { get; } 47 | 48 | /// 49 | /// The description of the argument 50 | /// 51 | public string Description { get; } 52 | } 53 | } -------------------------------------------------------------------------------- /Runtime/CommandLineArgumentAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e2a35175c806204b83491f21175e111 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/CommandLineCommandAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | 4 | namespace UnityCommandLineParser 5 | { 6 | /// 7 | /// An for making a static method to be run when a certain argument is included 8 | /// 9 | [AttributeUsage(AttributeTargets.Method)] 10 | [PublicAPI] 11 | public class CommandLineCommandAttribute : Attribute 12 | { 13 | /// 14 | /// Marks a method to be called if the argument is provided 15 | /// 16 | /// 17 | /// 18 | public CommandLineCommandAttribute([NotNull] string name) 19 | { 20 | if (string.IsNullOrWhiteSpace(name)) 21 | throw new ArgumentNullException(nameof(name)); 22 | 23 | Name = name; 24 | Description = ""; 25 | } 26 | 27 | /// 28 | /// Marks a method to be called if the argument is provided 29 | /// 30 | /// 31 | /// 32 | /// 33 | public CommandLineCommandAttribute([NotNull] string name, [NotNull] string description) 34 | { 35 | if (string.IsNullOrWhiteSpace(name)) 36 | throw new ArgumentNullException(nameof(name)); 37 | 38 | if (string.IsNullOrWhiteSpace(description)) 39 | throw new ArgumentNullException(nameof(description)); 40 | 41 | Name = name; 42 | Description = description; 43 | } 44 | 45 | /// 46 | /// What argument is this using 47 | /// 48 | public string Name { get; } 49 | 50 | /// 51 | /// The description of this argument 52 | /// 53 | public string Description { get; } 54 | } 55 | } -------------------------------------------------------------------------------- /Runtime/CommandLineCommandAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30d6174d23a237bc5afece3cac5a38ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/CommandLineParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Reflection; 6 | using JetBrains.Annotations; 7 | using McMaster.Extensions.CommandLineUtils; 8 | using McMaster.Extensions.CommandLineUtils.Abstractions; 9 | using UnityEngine; 10 | 11 | namespace UnityCommandLineParser 12 | { 13 | /// 14 | /// A command line parser designed for Unity 15 | /// 16 | public static class CommandLineParser 17 | { 18 | private const string LOGTag = "[CLP]"; 19 | private static ILogger logger; 20 | 21 | /// 22 | /// The that will use 23 | /// 24 | /// 25 | public static ILogger Logger 26 | { 27 | get => logger; 28 | set => logger = value ?? throw new ArgumentNullException(nameof(value)); 29 | } 30 | 31 | #region Initialization 32 | 33 | /// 34 | /// Initializes and parses the command line arguments 35 | /// 36 | /// This function is automatically called on Subsystem Registration using Unity's 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | #if !CLP_NO_AUTO_PARSE 43 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] 44 | #endif 45 | public static void Init() 46 | { 47 | Init(Environment.GetCommandLineArgs()); 48 | } 49 | 50 | /// 51 | /// Initializes and parses the command line arguments 52 | /// 53 | /// 54 | /// 55 | /// 56 | [PublicAPI] 57 | public static void Init([NotNull] string[] args) 58 | { 59 | //Make sure args are not null 60 | if (args == null) 61 | throw new ArgumentNullException(nameof(args)); 62 | 63 | //If a logger hasn't been added then just use the default Unity one 64 | logger ??= Debug.unityLogger; 65 | 66 | CommandLineApplication commandLineApp = new CommandLineApplication(new HelpTextGenerator(), new Console(), Environment.CurrentDirectory) 67 | { 68 | UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue 69 | }; 70 | 71 | //Add all of our arguments to commandLineApp 72 | Dictionary arguments = new Dictionary(); 73 | foreach (KeyValuePair argument in GetCommandLineArguments()) 74 | { 75 | CommandOption option = commandLineApp.Option( 76 | $"-{argument.Value.Name} <{argument.Value.Name.ToUpper()}>", argument.Value.Description, 77 | CommandOptionType.SingleValue); 78 | arguments.Add(option, argument.Key); 79 | } 80 | 81 | //Add all of our commands to commandLineApp 82 | Dictionary commands = new Dictionary(); 83 | foreach (KeyValuePair command in GetCommandLineCommands()) 84 | { 85 | //Create command action 86 | Action action; 87 | try 88 | { 89 | action = (Action) Delegate.CreateDelegate(typeof(Action), command.Key); 90 | } 91 | catch (Exception) 92 | { 93 | logger.LogError(LOGTag, 94 | $"{command.Key.Name} is an invalid method! It must have no arguments and be a void!"); 95 | continue; 96 | } 97 | 98 | CommandOption option = commandLineApp.Option($"-{command.Value.Name}", command.Value.Description, 99 | CommandOptionType.NoValue); 100 | commands.Add(option, action); 101 | } 102 | 103 | commandLineApp.OnExecute(() => 104 | { 105 | //Parse all arguments 106 | foreach (KeyValuePair argument in arguments) 107 | { 108 | if (!argument.Key.HasValue()) 109 | continue; 110 | 111 | IValueParser parser = commandLineApp.ValueParsers.GetParser(argument.Value.FieldType); 112 | 113 | //Epic fail ReSharper, because guess what, it can be null! 114 | // ReSharper disable once ConditionIsAlwaysTrueOrFalse 115 | if (parser == null) 116 | { 117 | logger.LogError(LOGTag, $"Unsupported base type '{argument.Value.FieldType.FullName}'!"); 118 | continue; 119 | } 120 | 121 | object parsedValue; 122 | try 123 | { 124 | parsedValue = parser.Parse("", argument.Key.Value(), CultureInfo.CurrentCulture); 125 | } 126 | catch (FormatException) 127 | { 128 | logger.LogError(LOGTag, $"Failed to parse {argument.Key.ShortName}!"); 129 | continue; 130 | } 131 | 132 | //Probs failed to parse 133 | if (parsedValue == null) 134 | continue; 135 | 136 | //Handling for enums 137 | if (argument.Value.FieldType.IsEnum) 138 | { 139 | object enumValue = Enum.ToObject(argument.Value.FieldType, parsedValue); 140 | argument.Value.SetValue(argument.Value, enumValue); 141 | continue; 142 | } 143 | 144 | argument.Value.SetValue(argument.Value, parsedValue); 145 | } 146 | 147 | //Parse all commands 148 | foreach (KeyValuePair command in commands) 149 | { 150 | if (command.Key.Values.Count <= 0) continue; 151 | try 152 | { 153 | command.Value.Invoke(); 154 | } 155 | catch (Exception ex) 156 | { 157 | logger.LogException(ex); 158 | } 159 | } 160 | }); 161 | 162 | //Parse our commands 163 | commandLineApp.Execute(args); 164 | } 165 | 166 | private const BindingFlags BindingFlags = System.Reflection.BindingFlags.Static | 167 | System.Reflection.BindingFlags.Public | 168 | System.Reflection.BindingFlags.NonPublic; 169 | 170 | /// 171 | /// Gets all fields with the attached 172 | /// 173 | /// 174 | [PublicAPI] 175 | public static Dictionary GetCommandLineArguments() 176 | { 177 | IEnumerable fields = AppDomain.CurrentDomain.GetAssemblies() 178 | .SelectMany(x => x.GetTypes()) 179 | .SelectMany(x => x.GetFields(BindingFlags)) 180 | .Where(x => x.GetCustomAttribute() != null); 181 | return fields.ToDictionary(fieldInfo => fieldInfo, 182 | fieldInfo => fieldInfo.GetCustomAttribute()); 183 | } 184 | 185 | /// 186 | /// Gets all methods with the attached 187 | /// 188 | /// 189 | [PublicAPI] 190 | public static Dictionary GetCommandLineCommands() 191 | { 192 | IEnumerable methods = AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()) 193 | .SelectMany(x => x.GetMethods(BindingFlags)) 194 | .Where(x => x.GetCustomAttribute() != null); 195 | return methods.ToDictionary(method => method, 196 | method => method.GetCustomAttribute()); 197 | } 198 | 199 | #endregion 200 | } 201 | } -------------------------------------------------------------------------------- /Runtime/CommandLineParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1d2c16f3c1c76e46b1293894c106010 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Console.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using McMaster.Extensions.CommandLineUtils; 4 | 5 | #nullable enable 6 | namespace UnityCommandLineParser 7 | { 8 | public class Console : IConsole 9 | { 10 | public void ResetColor() 11 | { 12 | 13 | } 14 | 15 | public TextWriter Out { get; } = TextWriter.Null; 16 | 17 | public TextWriter Error { get; } = TextWriter.Null; 18 | 19 | public TextReader In { get; } = TextReader.Null; 20 | 21 | public bool IsInputRedirected { get; } = false; 22 | 23 | public bool IsOutputRedirected { get; } = false; 24 | 25 | public bool IsErrorRedirected { get; } = false; 26 | 27 | public ConsoleColor ForegroundColor { get; set; } 28 | 29 | public ConsoleColor BackgroundColor { get; set; } 30 | 31 | public event ConsoleCancelEventHandler? CancelKeyPress = (sender, args) => 32 | { 33 | }; 34 | } 35 | } -------------------------------------------------------------------------------- /Runtime/Console.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1201897ad8e413f8e4101b499c0d4c4 3 | timeCreated: 1624450410 -------------------------------------------------------------------------------- /Runtime/HelpTextGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using McMaster.Extensions.CommandLineUtils; 3 | using McMaster.Extensions.CommandLineUtils.HelpText; 4 | 5 | namespace UnityCommandLineParser 6 | { 7 | public class HelpTextGenerator : IHelpTextGenerator 8 | { 9 | public void Generate(CommandLineApplication application, TextWriter output) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Runtime/HelpTextGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4756bb9ffe614687bd38678d5d8ef171 3 | timeCreated: 1624450393 -------------------------------------------------------------------------------- /Runtime/UnityCommandLineParser.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityCommandLineParser", 3 | "rootNamespace": "UnityCommandLineParser", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": true, 9 | "precompiledReferences": [ 10 | "McMaster.Extensions.CommandLineUtils.dll" 11 | ], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Runtime/UnityCommandLineParser.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3c323938430e974eb568e603b85eb9e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dev.voltstro.unitycommandlineparser", 3 | "displayName": "Unity Command Line Parser", 4 | "version": "2.1.2", 5 | "unity": "2020.3", 6 | "description": "A command line parser designed for Unity.", 7 | "keywords": [ 8 | "commandline", 9 | "arguments", 10 | "parser" 11 | ], 12 | "author": { 13 | "name": "Voltstro", 14 | "email": "me@voltstro.dev", 15 | "url": "https://voltstro.dev" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/Voltstro-Studios/UnityCommandLineParser.git" 20 | }, 21 | "type": "library", 22 | "dependencies": { 23 | "org.nuget.mcmaster.extensions.commandlineutils": "4.0.1" 24 | } 25 | } -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afc165cc51c2def45a580ddf54ec5466 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /thirdpartycredits.txt: -------------------------------------------------------------------------------- 1 | Unity Command Line Parser uses third party code for certain functions. 2 | The required legal notices for using such code and libraries are down below. 3 | 4 | ================================================================================ 5 | CommandLineUtils 6 | https://github.com/natemcmaster/CommandLineUtils 7 | ================================================================================ 8 | 9 | Copyright (c) .NET Foundation and Contributors 10 | Copyright (c) Nate McMaster 11 | 12 | All rights reserved. 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 15 | this file except in compliance with the License. You may obtain a copy of the 16 | License at 17 | 18 | http://www.apache.org/licenses/LICENSE-2.0 19 | 20 | Unless required by applicable law or agreed to in writing, software distributed 21 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 22 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 23 | specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /thirdpartycredits.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8a6455b2658664c992a4464bc365025 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------