Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: pkg/docgen/bin/docgen.dart

Issue 237863002: pkg/docgen: add --indent-json option (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | pkg/docgen/lib/src/generator.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/bin/docgen.dart
diff --git a/pkg/docgen/bin/docgen.dart b/pkg/docgen/bin/docgen.dart
index 16792d3a4c978389d0595a5a1593ff447908a666..f55a807f20e65649d390cbb1b74801e3e54c90ee 100644
--- a/pkg/docgen/bin/docgen.dart
+++ b/pkg/docgen/bin/docgen.dart
@@ -36,7 +36,9 @@ void main(List<String> arguments) {
path.join(options['sdk'], 'bin', 'dart') : 'dart';
var excludedLibraries = options['exclude-lib'];
- if(excludedLibraries == null) excludedLibraries = [];
+ if (excludedLibraries == null) excludedLibraries = [];
+
+ var indentJSON = options['indent-json'] as bool;
docgen(files,
packageRoot: options['package-root'],
@@ -52,7 +54,8 @@ void main(List<String> arguments) {
dartBinary: dartBinary,
pubScript: pubScript,
noDocs: options['no-docs'],
- startPage: startPage);
+ startPage: startPage,
+ indentJSON: indentJSON);
}
/**
@@ -144,6 +147,9 @@ ArgParser _initArgParser() {
'of the package in this argument, e.g. --start-page=intl will make '
'the start page of the viewer be the intl package.',
defaultsTo: null);
+ parser.addFlag('indent-json',
+ help: 'Indents each level of JSON output by two spaces',
+ defaultsTo: false, negatable: true);
return parser;
}
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | pkg/docgen/lib/src/generator.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698