anchor.diff:  import 'dart:io';
   
   import 'package:args/args.dart';
  +
  +typedef String _Generator(String libName, String className);
   
   /// Generates rule and rule test stub files (into `src/rules` and `test/rules`
   /// respectively), as well as the rule index (`rules.dart`).
  
positive.code: 
  void generateRule(String libName, {String outDir}) {
    // Generate rule stub.
    generateStub(libName, outDir: outDir);
  
    // Generate test stub.
    generateTest(libName, outDir: outDir);
  
    // Update rule registry.
    updateRuleRegistry(libName);
  }
  
  void generateStub(String libName, {String outDir}) {
    final generated = _generateStub(libName, toClassName(libName));
    if (outDir != null) {
      final outPath = '$outDir/lib/src/rules/$libName.dart';
      print('Writing to $outPath');
      new File(outPath).writeAsStringSync(generated);
    } else {
      print(generated);
    }
  }
  
  void generateTest(String libName, {String outDir}) {
    final generated = _generateTest(libName, toClassName(libName));
    if (outDir != null) {
      final outPath = '$outDir/test/rules/$libName.dart';
      print('Writing to $outPath');
      new File(outPath).writeAsStringSync(generated);
    } else {
      print(generated);
    }
  
negative.code:   print("  pub run test -N $libName");
  }
  
  String _generateLib(String libName, String className) => """
  // Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
  // for details. All rights reserved. Use of this source code is governed by a
  // BSD-style license that can be found in the LICENSE file.
  