Files
UnrealEngineUWP/Engine/Source/Programs/Shared/EpicGames.Core/CommandLineAttribute.cs

56 lines
1.4 KiB
C#
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
namespace EpicGames.Core
{
/// <summary>
/// Attribute to indicate the name of a command line argument
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, 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 { get; set; }
/// <summary>
/// Specifies a fixed value for this argument. Specifying an alternate value is not permitted.
/// </summary>
public string? Value { get; set; } = null;
/// <summary>
/// Whether this argument is required
/// </summary>
public bool Required { get; set; }
/// <summary>
/// For collection types, specifies the separator character between multiple arguments
/// </summary>
public char ListSeparator { get; set; } = '\0';
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 [CL 17018675 by jonathan adamczewski in ue5-main branch]
2021-08-02 14:45:39 -04:00
/// <summary>
/// Description of the operation.
/// </summary>
public string? Description { get; set; }
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 [CL 17018675 by jonathan adamczewski in ue5-main branch]
2021-08-02 14:45:39 -04:00
/// <summary>
/// Constructor
/// </summary>
/// <param name="prefix">Prefix for this argument</param>
public CommandLineAttribute(string? prefix = null)
{
Prefix = prefix;
if(prefix != null)
{
if(!prefix.StartsWith("-"))
{
throw new Exception("Command-line arguments must begin with a '-' character");
}
}
}
}
}