summaryrefslogtreecommitdiffstats
path: root/tools/gn/commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gn/commands.h')
-rw-r--r--tools/gn/commands.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/gn/commands.h b/tools/gn/commands.h
index c767742..1a30389 100644
--- a/tools/gn/commands.h
+++ b/tools/gn/commands.h
@@ -11,17 +11,14 @@
#include "base/strings/string_piece.h"
+class Target;
+
// Each "Run" command returns the value we should return from main().
namespace commands {
typedef int (*CommandRunner)(const std::vector<std::string>&);
-extern const char kDeps[];
-extern const char kDeps_HelpShort[];
-extern const char kDeps_Help[];
-int RunDeps(const std::vector<std::string>& args);
-
extern const char kDesc[];
extern const char kDesc_HelpShort[];
extern const char kDesc_Help[];
@@ -37,11 +34,6 @@ extern const char kHelp_HelpShort[];
extern const char kHelp_Help[];
int RunHelp(const std::vector<std::string>& args);
-extern const char kTree[];
-extern const char kTree_HelpShort[];
-extern const char kTree_Help[];
-int RunTree(const std::vector<std::string>& args);
-
// -----------------------------------------------------------------------------
struct CommandInfo {
@@ -59,6 +51,17 @@ typedef std::map<base::StringPiece, CommandInfo> CommandInfoMap;
const CommandInfoMap& GetCommands();
+// Helper functions for some commands ------------------------------------------
+
+// Runs a build for the given command line, returning the target identified by
+// the first non-switch command line parameter.
+//
+// Note that a lot of memory is leaked to avoid proper teardown under the
+// assumption that you will only run this once and exit.
+//
+// On failure, prints an error message and returns NULL.
+const Target* GetTargetForDesc(const std::vector<std::string>& args);
+
} // namespace commands
#endif // TOOLS_GN_COMMANDS_H_