anchor.diff:    var parser = new ArgParser(allowTrailingOptions: true);
     
     parser.addOption('output-dir', abbr: 'o', help: 'Output directory');
  +  parser.addOption('extends', abbr: 'e', 
  +      help: 'Extends polymer-element or DOM element (e.g., div, span)');
     
     var options, element;
     try {
       options = parser.parse(args);
  -    if (options.rest == null || options.rest.length > 1) {
  -      throw new FormatException("No element specified");
  +    if (options.rest == null || options.rest.isEmpty) {
  +      throw new FormatException('No element specified');
       }
       element = options.rest[0];
  -    _validateElementName(element);
  +    if (!_isPolymerElement(element)) {
  +      throw new FormatException('Must specify polymer-element to create.\n'
  +          'polymer-element must be all lowercase with at least 1 hyphen.');
  +    }
     } catch(e) {
  -    print('${e}.\n');
  +    print('$e\n');
       print('Usage:');
  -    print('  pub run polymer:new_element [-o output_dir] element-name');
  +    print('  pub run polymer:new_element [-o output_dir] [-e super-element] '
  +        'element-name');
  +    print(parser.getUsage());
       exitCode = 1;
       return;
     } 
  
positive.code:   return dir;
  }
  
  void _validateElementName(String element) {
    if (!element.contains('-') || element.toLowerCase() != element) {
      throw new FormatException('element-name must be all lower case '
          'and contain at least 1 hyphen');
    }
  }
  
  String _toCamelCase(String s) {
    return s[0].toUpperCase() + s.substring(1);
  }
  
  void _createBoilerPlate(String element, String directory,
                          int distanceToPackageRoot) {
    var segments = element.split('-');
    var capitalizedName = segments.map((e) => _toCamelCase(e)).join('');
    var underscoreName = element.replaceAll('-', '_'); 
    var pathToPackages = '../' * distanceToPackageRoot;
  
    String html = '''  
  <!-- import polymer-element's definition -->
  <link rel="import" href="${pathToPackages}packages/polymer/polymer.html">
  
  <polymer-element name="$element">
    <template>
      <style>
        <!-- template styling here -->
      </style>
      <!-- template content here -->
    </template>
    <script type="application/dart" src="${underscoreName}.dart"></script>
  </polymer-element>
  
negative.code:       distanceToPackageRoot--;
      }
    }
    
    var superElement = options['extends'];
    
    if ((superElement == null ) || 
        _isDOMElement(superElement) ||
        _isPolymerElement(superElement)) {
      try {
        _createBoilerPlate(element, options['extends'], outputDir, 
            distanceToPackageRoot);
      } on Exception catch(e, t) {
        print('Error creating files in $outputDir');
        print('$e $t');
        exitCode = 1;
        return;
      }
    } else {
      if (superElement.contains('-')) {
        print('Extending invalid element "$superElement". Polymer elements '
            'may contain only lowercase letters at least one hyphen.');
      } else {
        print('Extending invalid element "$superElement". $superElement is not '
            ' a builtin DOM type.');
      }
      exitCode = 1;
      return;
    }
  