anchor.diff:        abbr: 'f', help: 'File containing the results to send');
     parser.addOption('id', abbr: 'i', help: 'Buildbucket ID of this build');
     parser.addOption('base_revision', help: 'A try build\'s patch base');
  +  parser.addFlag('staging',
  +      abbr: 's', help: 'Publish to the staging system', defaultsTo: false);
   
     final options = parser.parse(args);
     if (options['help']) {
       usage(parser);
     }
  +
  +  if (options['result_file'] == null) {
  +    print('Error: option "result_file" is required.\n');
  +    usage(parser, exitCode: 1);
  +  }
  +
  +  if (options['auth_token'] == null) {
  +    print('Error: option "auth_token" is required.\n');
  +    usage(parser, exitCode: 1);
  +  }
  +
  +  final project = options['staging'] ? "dart-ci-staging" : "dart-ci";
   
     final client = http.Client();
   
  
positive.code: import 'package:args/args.dart';
  import 'package:http/http.dart' as http;
  
  void usage(ArgParser parser) {
    print('''
  Usage: post_results_to_pubsub.dart [OPTIONS]
  Posts Dart CI results as messages to Google Cloud Pub/Sub
  
negative.code:     print('No results in input file');
      return;
    }
  
    // TODO(karlklose): parse and validate data before sending it.
  
    final changedPattern = '"changed":true';
    List<String> changedResults =
  