Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update add helping messages #4472

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/src/command/add.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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":"<branch>","path":"<subdir>"}}'`''';
"foo:{git:{url: ../foo.git, ref: <branch>, path: <subdir>}}"`''';

@override
String get argumentsDescription =>
Expand Down
16 changes: 8 additions & 8 deletions test/testdata/goldens/help_test/pub add --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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":"<branch>","path":"<subdir>"}}'`
"foo:{git:{url: ../foo.git, ref: <branch>, path: <subdir>}}"`

Usage: pub add [options] [<section>:]<package>[:descriptor] [<section>:]<package2>[:descriptor] ...]
-h, --help Print this usage information.
Expand Down
Loading