• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 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_STANDARD_OUT_H_
6 #define TOOLS_GN_STANDARD_OUT_H_
7 
8 #include <string>
9 
10 enum TextDecoration {
11   DECORATION_NONE = 0,
12   DECORATION_DIM,
13   DECORATION_RED,
14   DECORATION_GREEN,
15   DECORATION_BLUE,
16   DECORATION_YELLOW
17 };
18 
19 void OutputString(const std::string& output,
20                   TextDecoration dec = DECORATION_NONE);
21 
22 // Prints a line for a command, assuming there is a colon. Everything before
23 // the colon is the command (and is highlighted). After the colon if there is
24 // a square bracket, the contents of the bracket is dimmed.
25 //
26 // The line is indented 2 spaces.
27 void PrintShortHelp(const std::string& line);
28 
29 // Rules:
30 // - Lines beginning with non-whitespace are highlighted up to the first
31 //   colon (or the whole line if not).
32 // - Lines whose first non-whitespace character is a # are dimmed.
33 void PrintLongHelp(const std::string& text);
34 
35 #endif  // TOOLS_GN_STANDARD_OUT_H_
36