Skip to content

Unhide the --example flag for relevant commands #4633

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

Merged
merged 1 commit into from
Aug 12, 2025
Merged
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
1 change: 0 additions & 1 deletion lib/src/command/add.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ For example (follow the same format including spaces):
defaultsTo: true,
help:
'Also update dependencies in `example/` after modifying pubspec.yaml in the root package (if it exists).',
hide: true,
);
}

Expand Down
1 change: 0 additions & 1 deletion lib/src/command/downgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class DowngradeCommand extends PubCommand {
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);

argParser.addOption(
Expand Down
1 change: 0 additions & 1 deletion lib/src/command/get.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class GetCommand extends PubCommand {
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);

argParser.addOption(
Expand Down
1 change: 0 additions & 1 deletion lib/src/command/remove.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ To remove a dependency override of a package prefix the package name with
'example',
defaultsTo: true,
help: 'Also update dependencies in `example/` (if it exists).',
hide: true,
);

argParser.addOption(
Expand Down
1 change: 0 additions & 1 deletion lib/src/command/upgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class UpgradeCommand extends PubCommand {
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);

argParser.addOption(
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/goldens/help_test/pub add --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Usage: pub add [options] [<section>:]<package>[:descriptor] [<section>:]<package
-n, --dry-run Report what dependencies would change but don't change any.
--[no-]precompile Build executables in immediate dependencies.
-C, --directory=<dir> Run this in the directory <dir>.
--[no-]example Also update dependencies in `example/` after modifying pubspec.yaml in the root package (if it exists).
(defaults to on)

Run "pub help" to see global options.
See https://dart.dev/tools/pub/cmd/pub-add for detailed documentation.
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/goldens/help_test/pub downgrade --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Usage: pub downgrade [dependencies...]
-h, --help Print this usage information.
--[no-]offline Use cached packages instead of accessing the network.
-n, --dry-run Report what dependencies would change but don't change any.
--[no-]example Also run in `example/` (if it exists).
(defaults to on)
-C, --directory=<dir> Run this in the directory <dir>.
--tighten Updates lower bounds in pubspec.yaml to match the resolved version.

Expand Down
2 changes: 2 additions & 0 deletions test/testdata/goldens/help_test/pub get --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Usage: pub get
has changed.
Useful for CI or deploying to production.
--[no-]precompile Build executables in immediate dependencies.
--[no-]example Also run in `example/` (if it exists).
(defaults to on)
-C, --directory=<dir> Run this in the directory <dir>.

Run "pub help" to see global options.
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/goldens/help_test/pub remove --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Usage: pub remove <package1> [<package2>...]
--[no-]offline Use cached packages instead of accessing the network.
-n, --dry-run Report what dependencies would change but don't change any.
--[no-]precompile Precompile executables in immediate dependencies.
--[no-]example Also update dependencies in `example/` (if it exists).
(defaults to on)
-C, --directory=<dir> Run this in the directory <dir>.

Run "pub help" to see global options.
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/goldens/help_test/pub upgrade --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Usage: pub upgrade [dependencies...]
--tighten Updates lower bounds in pubspec.yaml to match the resolved version.
--unlock-transitive Also upgrades the transitive dependencies of the listed [dependencies]
--major-versions Upgrades packages to their latest resolvable versions, and updates pubspec.yaml.
--[no-]example Also run in `example/` (if it exists).
(defaults to on)
-C, --directory=<dir> Run this in the directory <dir>.

Run "pub help" to see global options.
Expand Down
Loading