<commit_before>#!/usr/bin/env dart

import 'dart:io';
import 'package:pubviz/pubviz.dart';

void main() {
  var args = (new Options()).arguments;

  if(args.length != 1) {
    print("should only have one arg -> a path");
    exit(1);
    return;
  }

  final path = args[0];

  VizRoot.forDirectory(path)
    .then((VizRoot vp) {
      print(vp.toDot());
    });
}<commit_msg>handle running pubviz within a package directory without arguments<commit_after>#!/usr/bin/env dart

import 'dart:io';
import 'package:path/path.dart' as pathos;
import 'package:pubviz/pubviz.dart';

void main() {

  final path = _getPath();

  VizRoot.forDirectory(path)
    .then((VizRoot vp) {
      print(vp.toDot());
    });
}

String _getPath() {
  var args = (new Options()).arguments;

  if(args.isEmpty) {
    return pathos.current;
  }

  if(args.length != 1) {
    print("should only have one arg -> a path");
    exit(1);
  }
}
{'fraction_non_alphanumeric': 0.16612021857923498, 'fraction_numerical': 0.00546448087431694, 'mean_word_length': 3.300469483568075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1495035', 'n_tokens_mistral': 348, 'n_tokens_neox': 333, 'n_words': 76}