anchor.diff:      }
       if (hadInconsistentRequirements) {
         if (foundAnyInFlutterRepo)
  -        printError('You may need to run "dart ${path.normalize(path.relative(path.join(ArtifactStore.flutterRoot, 'dev/update_packages.dart')))} --upgrade".');
  +        printError('You may need to run "flutter update-packages --upgrade".');
         if (foundAnyInCurrentDirectory)
           printError('You may need to run "pub upgrade".');
       }
  
positive.code:       }
      }
  
      if (argResults['flutter-repo']) {
        // .../examples/*/*.dart
        // .../examples/*/lib/main.dart
        Directory examples = new Directory(path.join(ArtifactStore.flutterRoot, 'examples'));
        for (FileSystemEntity entry in examples.listSync()) {
          if (entry is Directory) {
            bool foundOne = false;
            for (FileSystemEntity subentry in entry.listSync()) {
              if (subentry is File && subentry.path.endsWith('.dart')) {
                dartFiles.add(subentry.path);
                foundOne = true;
              } else if (subentry is Directory && path.basename(subentry.path) == 'lib') {
                String mainPath = path.join(subentry.path, 'main.dart');
                if (FileSystemEntity.isFileSync(mainPath)) {
                  dartFiles.add(mainPath);
                  foundOne = true;
                }
              }
            }
            if (foundOne)
              pubSpecDirectories.add(entry.path);
          }
        }
  
        // .../packages/*/bin/*.dart
        // .../packages/*/lib/main.dart
        // .../packages/*/test/*_test.dart
        // .../packages/*/test/*/*_test.dart
        // .../packages/*/benchmark/*/*_bench.dart
        Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages'));
        for (FileSystemEntity entry in packages.listSync()) {
          if (entry is Directory) {
            bool foundOne = false;
  
            Directory binDirectory = new Directory(path.join(entry.path, 'bin'));
            if (binDirectory.existsSync()) {
              for (FileSystemEntity subentry in binDirectory.listSync()) {
                if (subentry is File && subentry.path.endsWith('.dart')) {
                  dartFiles.add(subentry.path);
                  foundOne = true;
                }
              }
            }
  
            String mainPath = path.join(entry.path, 'lib', 'main.dart');
            if (FileSystemEntity.isFileSync(mainPath)) {
              dartFiles.add(mainPath);
              foundOne = true;
            }
  
            Directory testDirectory = new Directory(path.join(entry.path, 'test'));
            if (testDirectory.existsSync()) {
              for (FileSystemEntity entry in testDirectory.listSync()) {
                if (entry is Directory) {
                  for (FileSystemEntity subentry in entry.listSync()) {
                    if (subentry is File && subentry.path.endsWith('_test.dart')) {
                      dartFiles.add(subentry.path);
                      foundOne = true;
                    }
                  }
                } else if (entry is File && entry.path.endsWith('_test.dart')) {
                  dartFiles.add(entry.path);
                  foundOne = true;
                }
              }
            }
  
            Directory benchmarkDirectory = new Directory(path.join(entry.path, 'benchmark'));
            if (benchmarkDirectory.existsSync()) {
              for (FileSystemEntity entry in benchmarkDirectory.listSync()) {
                if (entry is Directory) {
                  for (FileSystemEntity subentry in entry.listSync()) {
                    if (subentry is File && subentry.path.endsWith('_bench.dart')) {
                      dartFiles.add(subentry.path);
                      foundOne = true;
                    }
                  }
                } else if (entry is File && entry.path.endsWith('_bench.dart')) {
                  dartFiles.add(entry.path);
                  foundOne = true;
                }
              }
            }
  
            if (foundOne)
              pubSpecDirectories.add(entry.path);
          }
        }
      }
  
      if (argResults['current-directory']) {
        // ./*.dart
        Directory currentDirectory = new Directory('.');
        bool foundOne = false;
        for (FileSystemEntity entry in currentDirectory.listSync()) {
          if (entry is File && entry.path.endsWith('.dart')) {
            dartFiles.add(entry.path);
            foundOne = true;
          }
        }
        if (foundOne) {
          pubSpecDirectories.add('.');
          foundAnyInCurrentDirectory = true;
        }
      }
  
      if (argResults['current-package']) {
        // ./lib/main.dart
        String mainPath = 'lib/main.dart';
        if (FileSystemEntity.isFileSync(mainPath)) {
          dartFiles.add(mainPath);
          pubSpecDirectories.add('.');
          foundAnyInCurrentDirectory = true;
        }
      }
  
      // prepare a Dart file that references all the above Dart files
      StringBuffer mainBody = new StringBuffer();
      for (int index = 0; index < dartFiles.length; index += 1)
        mainBody.writeln('import \'${path.normalize(path.absolute(dartFiles[index]))}\' as file$index;');
      mainBody.writeln('void main() { }');
  
      // prepare a union of all the .packages files
  
negative.code:     stopwatch.stop();
      String elapsed = (stopwatch.elapsedMilliseconds / 1000.0).toStringAsFixed(1);
  
      host.deleteSync(recursive: true);
  
      if (exitCode < 0 || exitCode > 3) // 0 = nothing, 1 = hints, 2 = warnings, 3 = errors
        return exitCode;
  
  