OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 library mojom.command_runner; | |
6 | |
7 import 'dart:async'; | |
8 import 'dart:io'; | |
9 | |
10 import 'package:args/args.dart'; | |
11 import 'package:args/command_runner.dart'; | |
12 import 'package:mojom/src/commands/check.dart'; | |
13 import 'package:mojom/src/commands/gen.dart'; | |
14 import 'package:mojom/src/commands/single.dart'; | |
15 | |
16 class MojomCommandRunner extends CommandRunner { | |
17 MojomCommandRunner() | |
18 : super("mojom", "mojom is a tool for managing Mojo bindings for Dart.") { | |
19 super.argParser.addFlag('dry-run', | |
20 abbr: 'd', | |
21 defaultsTo: false, | |
22 negatable: false, | |
23 help: 'Print the operations that would have been run, but' | |
24 'do not run anything.'); | |
25 super.argParser.addFlag('ignore-duplicates', | |
26 abbr: 'i', | |
27 defaultsTo: false, | |
28 negatable: false, | |
29 help: 'Ignore generation of a .mojom.dart file into the same location ' | |
30 'as an existing file. By default this is an error'); | |
31 super.argParser.addOption('mojom-root', | |
32 abbr: 'r', | |
33 defaultsTo: Directory.current.path, | |
34 help: 'Directory from which to begin the search for .mojom files if ' | |
35 'needed.'); | |
36 super.argParser.addOption('mojo-sdk', | |
37 abbr: 'm', | |
38 defaultsTo: Platform.environment['MOJO_SDK'], | |
39 help: 'Path to the Mojo SDK, which can also be specified ' | |
40 'with the environment variable MOJO_SDK.'); | |
41 super.argParser.addOption('skip', | |
42 abbr: 's', allowMultiple: true, help: 'Directories to skip.'); | |
43 super.argParser.addFlag('verbose', | |
44 abbr: 'v', | |
45 defaultsTo: false, | |
46 negatable: false, | |
47 help: 'Show extra output about what mojom is doing.'); | |
48 | |
49 super.addCommand(new CheckCommand()); | |
50 super.addCommand(new SinglePackageCommand()); | |
51 super.addCommand(new GenCommand()); | |
52 } | |
53 } | |
OLD | NEW |