main function

void main(
  1. List<String> arguments
)

Implementation

void main(List<String> arguments) {
  if (arguments.isEmpty) {
    stderr.writeln('Usage: dart classify_library.dart <file_path>');
    exit(1);
  }

  String filePath = arguments[0];
  File file = File(filePath);

  if (!file.existsSync()) {
    stderr.writeln('Error: File not found.');
    exit(1);
  }

  String fileType = classifyFile(file);
  stdout.writeln('File type: $fileType');
}