From 68f80bb1cc6fd763dc6f42c50a93c77a0ac6f94b Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 13 Dec 2024 23:38:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=92=A1=20Update=20helping=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/command/add.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/command/add.dart b/lib/src/command/add.dart index 5fe7f048a..eb0c5b067 100644 --- a/lib/src/command/add.dart +++ b/lib/src/command/add.dart @@ -58,7 +58,7 @@ Make dependency overrides by prefixing with "override:". Add packages with specific constraints or other sources by giving a descriptor after a colon. -For example: +For example (follow the same format including spaces): * Add a hosted dependency at newest compatible stable version: `$topLevelProgram pub add foo` * Add a hosted dev dependency at newest compatible stable version: @@ -67,19 +67,19 @@ For example: `$topLevelProgram pub add foo:^1.2.3` * Add multiple dependencies: `$topLevelProgram pub add foo dev:bar` + * Add a dependency override: + `$topLevelProgram pub add override:foo:1.0.0` * Add a path dependency: - `$topLevelProgram pub add 'foo:{"path":"../foo"}'` + `$topLevelProgram pub add "foo:{path: ../foo}"` * Add a hosted dependency: - `$topLevelProgram pub add 'foo:{"hosted":"my-pub.dev"}'` + `$topLevelProgram pub add "foo:{hosted: https://my-pub.dev}"` * Add an sdk dependency: - `$topLevelProgram pub add 'foo:{"sdk":"flutter"}'` + `$topLevelProgram pub add "foo:{sdk: flutter}"` * Add a git dependency: - `$topLevelProgram pub add 'foo:{"git":"https://github.com/foo/foo"}'` - * Add a dependency override: - `$topLevelProgram pub add 'override:foo:1.0.0'` + `$topLevelProgram pub add "foo:{git: https://github.com/foo/foo}"` * Add a git dependency with a path and ref specified: `$topLevelProgram pub add \\ - 'foo:{"git":{"url":"../foo.git","ref":"","path":""}}'`'''; + "foo:{git:{url: ../foo.git, ref: , path: }}"`'''; @override String get argumentsDescription => From 6d612184372d7227305d784633cc04c89b7f0872 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Mon, 16 Dec 2024 16:21:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20Fix=20the=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goldens/help_test/pub add --help.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testdata/goldens/help_test/pub add --help.txt b/test/testdata/goldens/help_test/pub add --help.txt index 5c4f71b42..45611e0c5 100644 --- a/test/testdata/goldens/help_test/pub add --help.txt +++ b/test/testdata/goldens/help_test/pub add --help.txt @@ -14,7 +14,7 @@ Make dependency overrides by prefixing with "override:". Add packages with specific constraints or other sources by giving a descriptor after a colon. -For example: +For example (follow the same format including spaces): * Add a hosted dependency at newest compatible stable version: `dart pub add foo` * Add a hosted dev dependency at newest compatible stable version: @@ -23,19 +23,19 @@ For example: `dart pub add foo:^1.2.3` * Add multiple dependencies: `dart pub add foo dev:bar` + * Add a dependency override: + `dart pub add 'override:foo:1.0.0'` * Add a path dependency: - `dart pub add 'foo:{"path":"../foo"}'` + `dart pub add "foo:{path: ../foo}"` * Add a hosted dependency: - `dart pub add 'foo:{"hosted":"my-pub.dev"}'` + `dart pub add "foo:{hosted: https://my-pub.dev}"` * Add an sdk dependency: - `dart pub add 'foo:{"sdk":"flutter"}'` + `dart pub add "foo:{sdk: flutter}"` * Add a git dependency: - `dart pub add 'foo:{"git":"https://github.com/foo/foo"}'` - * Add a dependency override: - `dart pub add 'override:foo:1.0.0'` + `dart pub add "foo:{git: https://github.com/foo/foo}"` * Add a git dependency with a path and ref specified: `dart pub add \ - 'foo:{"git":{"url":"../foo.git","ref":"","path":""}}'` + "foo:{git:{url: ../foo.git, ref: , path: }}"` Usage: pub add [options] [
:][:descriptor] [
:][:descriptor] ...] -h, --help Print this usage information. From 3b2545e4eb942abf62196218c1af65982db023bb Mon Sep 17 00:00:00 2001 From: Alex Li Date: Mon, 16 Dec 2024 17:18:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=85=20Update=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/testdata/goldens/help_test/pub add --help.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdata/goldens/help_test/pub add --help.txt b/test/testdata/goldens/help_test/pub add --help.txt index 45611e0c5..f6f73fb96 100644 --- a/test/testdata/goldens/help_test/pub add --help.txt +++ b/test/testdata/goldens/help_test/pub add --help.txt @@ -24,7 +24,7 @@ For example (follow the same format including spaces): * Add multiple dependencies: `dart pub add foo dev:bar` * Add a dependency override: - `dart pub add 'override:foo:1.0.0'` + `dart pub add override:foo:1.0.0` * Add a path dependency: `dart pub add "foo:{path: ../foo}"` * Add a hosted dependency: