<commit_before>///
/// Script to create boilerplate for a Polymer element.
/// Produces new .html entry point for a polymer app and updates the
/// pubspec.yaml to reflect it.
///
/// Run this script with pub run:
///
///     pub run polymer:new_entry <html_file>
///
import 'dart:io';
import 'package:args/args.dart';
import 'package:path/path.dart' as path;
import 'package:yaml/yaml.dart';
import 'package:source_span/source_span.dart';

void printUsage() {
  print('pub run polymer:new_entry entry_point_file.html');
}

void main(List<String> args) {
  var parser = new ArgParser(allowTrailingOptions: true);
  parser.addFlag('help', abbr: 'h');
  var entryPoint;

  try {
    var options = parser.parse(args);
    if (options['help'] != null) {
      printUsage();
      return;
    }
    entryPoint = options.rest[0];
  } catch(e) {
    print('$e\n');
    printUsage();
    exitCode = 1;
    return;
  }

  // If the entrypoint file has no extension, add .html to it.
  if (path.extension(entryPoint) == '') {
    entryPoint = '${entryPoint}.html';
  }<commit_msg>Correct handling of parameters passed to main.<commit_after>///
/// Script to create boilerplate for a Polymer element.
/// Produces new .html entry point for a polymer app and updates the
/// pubspec.yaml to reflect it.
///
/// Run this script with pub run:
///
///     pub run polymer:new_entry <html_file>
///
import 'dart:io';
import 'package:args/args.dart';
import 'package:path/path.dart' as path;
import 'package:yaml/yaml.dart';
import 'package:source_span/source_span.dart';

void printUsage() {
  print('pub run polymer:new_entry entry_point_file.html');
}

void main(List<String> args) {
  var parser = new ArgParser(allowTrailingOptions: true);
  parser.addFlag('help', abbr: 'h');
  var entryPoint;

  try {
    var options = parser.parse(args);
    if (options['help']) {
      printUsage();
      return;
    }
    entryPoint = options.rest[0];
  } catch(e) {
    print('$e\n');
    printUsage();
    exitCode = 1;
    return;
  }

  // If the entrypoint file has no extension, add .html to it.
  if (path.extension(entryPoint) == '') {
    entryPoint = '${entryPoint}.html';
  }
{'fraction_non_alphanumeric': 0.15196304849884526, 'fraction_numerical': 0.0018475750577367205, 'mean_word_length': 3.263779527559055, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6320069', 'n_tokens_mistral': 723, 'n_tokens_neox': 702, 'n_words': 201}