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

Unified Diff: pkg/args/lib/src/utils.dart

Issue 797473002: Add a CommandRunner class for dispatching commands to args. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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: pkg/args/lib/src/utils.dart
diff --git a/pkg/args/lib/src/utils.dart b/pkg/args/lib/src/utils.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9e71f50a82b6b8541e464b45b63092365da4181e
--- /dev/null
+++ b/pkg/args/lib/src/utils.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, 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.
+
+library args.utils;
+
+/// Pads [source] to [length] by adding spaces at the end.
+String padRight(String source, int length) {
+ final result = new StringBuffer();
+ result.write(source);
+
+ while (result.length < length) {
+ result.write(' ');
+ }
Bob Nystrom 2014/12/11 20:25:31 result.write(' ' * (length - result.length));
nweiz 2014/12/11 23:55:24 Done.
+
+ return result.toString();
+}

Powered by Google App Engine
This is Rietveld 408576698