| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| import 'dart:async'; | |
| import '../command.dart'; | |
| import '../oauth2.dart' as oauth2; | |
| /// Handles the `logout` pub command. | |
| class LogoutCommand extends PubCommand { | |
| @override | |
| String get name => 'logout'; | |
| @override | |
| String get description => 'Log out of pub.dev.'; | |
| @override | |
| bool get takesArguments => false; | |
| LogoutCommand(); | |
| @override | |
| Future<void> runProtected() async { | |
| oauth2.logout(); | |
| } | |
| } |