Chromium Code Reviews| Index: tools/gn/gn_main.cc |
| diff --git a/tools/gn/gn_main.cc b/tools/gn/gn_main.cc |
| index 9c86ab5f01468947a8e958183ed35de5d507e6ec..bd12918cac5a84909120f8d1e580873f4ed01ab4 100644 |
| --- a/tools/gn/gn_main.cc |
| +++ b/tools/gn/gn_main.cc |
| @@ -8,6 +8,14 @@ |
| #include "tools/gn/commands.h" |
| #include "tools/gn/err.h" |
| #include "tools/gn/location.h" |
| +#include "tools/gn/standard_out.h" |
| + |
| +// Only the GN-generated build makes this header for now. |
|
viettrungluu
2013/11/06 18:39:22
Is this a TODO?
|
| +#if defined(GN_BUILD) |
| +#include "build/util/last_change.h" |
| +#else |
| +#define LAST_CHANGE "UNKNOWN" |
| +#endif |
| namespace { |
| @@ -39,6 +47,10 @@ int main(int argc, char** argv) { |
| if (cmdline.HasSwitch("help")) { |
| // Make "--help" default to help command. |
| command = commands::kHelp; |
| + } else if (cmdline.HasSwitch("version")) { |
| + // Make "--version" print the version and exit. |
| + OutputString(std::string(LAST_CHANGE) + "\n"); |
| + exit(0); |
| } else if (args.empty()) { |
| command = commands::kGen; |
| } else { |