1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TOOLS_GN_SWITCHES_H_ 6 #define TOOLS_GN_SWITCHES_H_ 7 8 #include <map> 9 #include <string_view> 10 11 namespace switches { 12 13 struct SwitchInfo { 14 SwitchInfo(); 15 SwitchInfo(const char* short_help, const char* long_help); 16 17 const char* short_help; 18 const char* long_help; 19 }; 20 21 using SwitchInfoMap = std::map<std::string_view, SwitchInfo>; 22 23 // Returns the mapping of all global switches. 24 const SwitchInfoMap& GetSwitches(); 25 26 // This file contains global switches. If a command takes specific ones only 27 // to that command, just put them in that command's .cc file. 28 29 extern const char kArgs[]; 30 extern const char kArgs_HelpShort[]; 31 extern const char kArgs_Help[]; 32 33 extern const char kColor[]; 34 extern const char kColor_HelpShort[]; 35 extern const char kColor_Help[]; 36 37 extern const char kDotfile[]; 38 extern const char kDotfile_HelpShort[]; 39 extern const char kDotfile_Help[]; 40 41 extern const char kFailOnUnusedArgs[]; 42 extern const char kFailOnUnusedArgs_HelpShort[]; 43 extern const char kFailOnUnusedArgs_Help[]; 44 45 extern const char kMarkdown[]; 46 extern const char kMarkdown_HelpShort[]; 47 extern const char kMarkdown_Help[]; 48 49 extern const char kMetaDataKeys[]; 50 extern const char kMetaDataKeys_HelpShort[]; 51 extern const char kMetaDataKeys_Help[]; 52 53 extern const char kMetaWalkKeys[]; 54 extern const char kMetaWalkKeys_HelpShort[]; 55 extern const char kMetaWalkKeys_Help[]; 56 57 extern const char kMetaRebaseFiles[]; 58 extern const char kMetaRebaseFiles_HelpShort[]; 59 extern const char kMetaRebaseFiles_Help[]; 60 61 extern const char kNoColor[]; 62 extern const char kNoColor_HelpShort[]; 63 extern const char kNoColor_Help[]; 64 65 extern const char kScriptExecutable[]; 66 extern const char kScriptExecutable_HelpShort[]; 67 extern const char kScriptExecutable_Help[]; 68 69 extern const char kQuiet[]; 70 extern const char kQuiet_HelpShort[]; 71 extern const char kQuiet_Help[]; 72 73 extern const char kRoot[]; 74 extern const char kRoot_HelpShort[]; 75 extern const char kRoot_Help[]; 76 77 extern const char kRuntimeDepsListFile[]; 78 extern const char kRuntimeDepsListFile_HelpShort[]; 79 extern const char kRuntimeDepsListFile_Help[]; 80 81 extern const char kThreads[]; 82 extern const char kThreads_HelpShort[]; 83 extern const char kThreads_Help[]; 84 85 extern const char kTime[]; 86 extern const char kTime_HelpShort[]; 87 extern const char kTime_Help[]; 88 89 extern const char kTracelog[]; 90 extern const char kTracelog_HelpShort[]; 91 extern const char kTracelog_Help[]; 92 93 extern const char kVerbose[]; 94 extern const char kVerbose_HelpShort[]; 95 extern const char kVerbose_Help[]; 96 97 extern const char kVersion[]; 98 extern const char kVersion_HelpShort[]; 99 extern const char kVersion_Help[]; 100 101 // This switch is used by several commands. It is here so it can be shared, 102 // but it's documented in the individual commands it applies to rather than 103 // globally. 104 extern const char kAllToolchains[]; 105 #define ALL_TOOLCHAINS_SWITCH_HELP \ 106 " --all-toolchains\n" \ 107 " Normally only inputs in the default toolchain will be included.\n" \ 108 " This switch will turn on matching all toolchains.\n" \ 109 "\n" \ 110 " For example, a file is in a target might be compiled twice:\n" \ 111 " once in the default toolchain and once in a secondary one. Without\n" \ 112 " this flag, only the default toolchain one will be matched by\n" \ 113 " wildcards. With this flag, both will be matched.\n" 114 115 } // namespace switches 116 117 #endif // TOOLS_GN_SWITCHES_H_ 118