blob: 167a260d8594b6e6df3b51d4ff3756fb0e6db500 [file] [log] [blame]
// Copyright (c) 2012, 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 'package:test/test.dart';
import 'test_pub.dart';
void main() {
test('running pub with no command displays usage', () {
return runPub(args: [], output: """
Pub is a package manager for Dart.
Usage: pub <command> [arguments]
Global options:
-h, --help Print this usage information.
--version Print pub version.
--[no-]trace Print debugging information when an error occurs.
--verbosity Control output verbosity.
[all] Show all output including internal tracing messages.
[error] Show only errors.
[io] Also show IO operations.
[normal] Show errors, warnings, and user messages.
[solver] Show steps during version resolution.
[warning] Show only errors and warnings.
-v, --verbose Shortcut for "--verbosity=all".
Available commands:
add Add a dependency to pubspec.yaml.
cache Work with the system cache.
deps Print package dependencies.
downgrade Downgrade the current package's dependencies to oldest versions.
get Get the current package's dependencies.
global Work with global packages.
login Log into pub.dev.
logout Log out of pub.dev.
outdated Analyze your dependencies to find which ones can be upgraded.
publish Publish the current package to pub.dartlang.org.
remove Removes a dependency from the current package.
run Run an executable from a package.
upgrade Upgrade the current package's dependencies to latest versions.
uploader Manage uploaders for a package on pub.dartlang.org.
version Print pub version.
Run "pub help <command>" for more information about a command.
See https://dart.dev/tools/pub/cmd for detailed documentation.
""");
});
test('running pub with just --version displays version', () {
return runPub(args: ['--version'], output: 'Pub 0.1.2+3');
});
}