Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: sdk/lib/_internal/pub/lib/src/command_install.dart

Issue 14680005: Add offline support to pub install and update. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/command_install.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command_install.dart b/sdk/lib/_internal/pub/lib/src/command_install.dart
index d51b553250bf101619744997cd5d29a2f8769102..6c3e510bc933c704dfe4e0d433f209f5d6b7d40d 100644
--- a/sdk/lib/_internal/pub/lib/src/command_install.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_install.dart
@@ -6,6 +6,8 @@ library command_install;
import 'dart:async';
+import 'package:args/args.dart';
+
import 'command.dart';
import 'entrypoint.dart';
import 'log.dart' as log;
@@ -15,6 +17,14 @@ class InstallCommand extends PubCommand {
String get description => "Install the current package's dependencies.";
String get usage => "pub install";
+ ArgParser get commandParser {
+ return new ArgParser()
+ ..addFlag('offline',
+ help: 'Use cached packages instead of accessing the network');
nweiz 2013/05/06 23:02:25 Trailing period.
Bob Nystrom 2013/05/07 21:03:09 We use periods for the command descriptions but no
nweiz 2013/05/07 21:14:49 All the global options have periods. I think it's
+ }
+
+ bool get isOffline => commandOptions['offline'];
+
Future onRun() {
return entrypoint.installDependencies()
.then((_) => log.message("Dependencies installed!"));

Powered by Google App Engine
This is Rietveld 408576698