Files
UnrealEngineUWP/Engine/Source/Programs/Shared/EpicGames.Core/CommandLineAttribute.cs
jonathan adamczewski f3c823dcaa UnrealBuildTool:
Add a -Help option that prints descriptions of global options.
(Tool mode options are not available - support for those may be added in a future CL)

Example output:

Global options:
  -Help               :  Display this help.
  -Verbose            :  Increase output verbosity
  -VeryVerbose        :  Increase output verbosity more
  -Log                :  Specify a log file location instead of the default Engine/Programs/UnrealBuildTool/Log.txt
  -Timestamps         :  Include timestamps in the log
  -FromMsBuild        :  Format messages for msbuild
  -Progress           :  Write progress messages in a format that can be parsed by other programs
  -NoMutex            :  Allow more than one instance of the program to run at once
  -WaitMutex          :  Wait for another instance to finish and then start, rather than aborting immediately
  -RemoteIni          :  Remote tool ini directory
  -Mode=              :  Select tool mode. One of the following (default tool mode is "Build"):
                           AggregateParsedTimingInfo, Build, Clean, Deploy, Execute, GenerateClangDatabase, GenerateProjectFiles,
                           IOSPostBuildSync, JsonExport, ParseMsvcTimingInfo, PVSGather, QueryTargets, SetupPlatforms,
                           ValidatePlatforms, WriteDocumentation, WriteMetadata
  -Clean              :  Clean build products. Equivalent to -Mode=Clean
  -ProjectFiles       :  Generate project files based on IDE preference. Equivalent to -Mode=GenerateProjectFiles
  -ProjectFileFormat= :  Generate project files in specified format. May be used multiple times.
  -Makefile           :  Generate Linux Makefile
  -CMakefile          :  Generate project files for CMake
  -QMakefile          :  Generate project files for QMake
  -KDevelopfile       :  Generate project files for KDevelop
  -CodeliteFiles      :  Generate project files for Codelite
  -XCodeProjectFiles  :  Generate project files for XCode
  -EddieProjectFiles  :  Generate project files for Eddie
  -VSCode             :  Generate project files for Visual Studio Code
  -VSMac              :  Generate project files for Visual Studio Mac
  -CLion              :  Generate project files for CLion
  -Rider              :  Generate project files for Rider

#jira none

#ROBOMERGE-SOURCE: CL 17018675 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v839-17012307)

[CL 17018680 by jonathan adamczewski in ue5-release-engine-test branch]
2021-08-02 14:45:58 -04:00

61 lines
1.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace EpicGames.Core
{
/// <summary>
/// Attribute to indicate the name of a command line argument
/// </summary>
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
public class CommandLineAttribute : Attribute
{
/// <summary>
/// Prefix for the option, with a leading '-' and trailing '=' character if a value is expected.
/// </summary>
public string? Prefix;
/// <summary>
/// Specifies a fixed value for this argument. Specifying an alternate value is not permitted.
/// </summary>
public string? Value = null;
/// <summary>
/// Whether this argument is required
/// </summary>
public bool Required;
/// <summary>
/// For collection types, specifies the separator character between multiple arguments
/// </summary>
public char ListSeparator = '\0';
/// <summary>
/// Description of the operation.
/// </summary>
public string? Description;
/// <summary>
/// Constructor
/// </summary>
/// <param name="Prefix">Prefix for this argument</param>
public CommandLineAttribute(string? Prefix = null)
{
this.Prefix = Prefix;
if(Prefix != null)
{
if(!Prefix.StartsWith("-"))
{
throw new Exception("Command-line arguments must begin with a '-' character");
}
}
}
}
}