anchor.diff:          expect(logger.out, contains('A tool to improve visibility into your Dart projects.'));
           expect(logger.out, contains('commands:'));
           expect(logger.err, isEmpty);
  +      });
  +    });
  +
  +    test('bad command', () {
  +      Tuneup tuneup = new Tuneup(logger);
  +      return tuneup.processArgs(['foo_command'], directory: foo).then((_) {
  +        expect(logger.out, contains('A tool to improve visibility into your Dart projects.'));
  +        expect(logger.out, contains('commands:'));
  +        expect(logger.err, isEmpty);
  +      });
  +    });
  +
  +    test('bad arg', () {
  +      Tuneup tuneup = new Tuneup(logger);
  +      return tuneup.processArgs(['--foo', 'bar'], directory: foo).then((_) {
  +        fail('should have thrown');
  +      }).catchError((e) {
  +        expect(e is ArgError, true);
  +        expect(e.message, contains('Could not find an option named'));
         });
       });
   
  
positive.code:       Tuneup tuneup = new Tuneup(logger);
        return tuneup.processArgs(['init'], directory: foo).then((_) {
          expect(new File('foo/bin/helloworld.dart').existsSync(), true);
        }).then((_) {
          return tuneup.processArgs(['stats'], directory: foo).then((_) {
            expect(logger.out, contains('1 source files, 3 lines of code.'));
            expect(logger.err, isEmpty);
          });
        });
  
negative.code:       });
      });
  
      test('analyze with errors', () {
        Tuneup tuneup = new Tuneup(logger);
        return tuneup.processArgs(['init'], directory: foo).then((_) {
          File f = new File('foo/bin/helloworld.dart');
          expect(f.existsSync(), true);
          f.writeAsStringSync(_errorText);
        }).then((_) {
          return tuneup.processArgs(['analyze'], directory: foo);
        }).then((_) {
          fail('expected analysis errors');
        }).catchError((e) {
          expect(e is ExitCode, true);
          expect(logger.out, contains('2 issues found; analyzed 1 source file in'));
          expect(logger.err, isEmpty);
        });
      });
  
      test('clean', () {
        Tuneup tuneup = new Tuneup(logger);
        return tuneup.processArgs(['init'], directory: foo).then((_) {
  