@@ -1517,6 +1517,84 @@ void main() {
15171517 },
15181518 );
15191519 });
1520+
1521+ testUsingContext ('preserves expected hidden and visible options across verboseHelp modes' , () {
1522+ final defaultCommand = AttachCommand (
1523+ buildSystem: buildSystem,
1524+ buildTargets: const BuildTargetsImpl (),
1525+ xcode: null ,
1526+ toolContext: createToolContext (),
1527+ );
1528+
1529+ final visibleByDefault = < String > {
1530+ for (final entry in defaultCommand.argParser.options.entries)
1531+ if (! entry.value.hide) entry.key,
1532+ };
1533+ final hiddenByDefault = < String > {
1534+ for (final entry in defaultCommand.argParser.options.entries)
1535+ if (entry.value.hide) entry.key,
1536+ };
1537+
1538+ expect (
1539+ visibleByDefault,
1540+ unorderedEquals (< String > [
1541+ 'help' ,
1542+ 'debug' ,
1543+ 'profile' ,
1544+ 'target' ,
1545+ 'device-vmservice-port' ,
1546+ 'host-vmservice-port' ,
1547+ 'dart-define' ,
1548+ 'dart-define-from-file' ,
1549+ 'device-user' ,
1550+ 'device-timeout' ,
1551+ 'device-connection' ,
1552+ 'dds' ,
1553+ 'dds-port' ,
1554+ 'debug-url' ,
1555+ 'app-id' ,
1556+ 'pid-file' ,
1557+ 'track-widget-creation' ,
1558+ ]),
1559+ );
1560+ expect (
1561+ hiddenByDefault,
1562+ unorderedEquals (< String > [
1563+ 'vm-service-port' ,
1564+ 'ipv6' ,
1565+ 'output-dill' ,
1566+ 'filesystem-root' ,
1567+ 'filesystem-scheme' ,
1568+ 'initialize-from-dill' ,
1569+ 'assume-initialize-from-dill-up-to-date' ,
1570+ 'native-assets-yaml-file' ,
1571+ 'disable-dds' ,
1572+ 'devtools' ,
1573+ 'devtools-server-address' ,
1574+ 'target-model' ,
1575+ 'module' ,
1576+ 'enable-experiment' ,
1577+ 'debug-port' ,
1578+ 'report-ready' ,
1579+ 'project-root' ,
1580+ 'machine' ,
1581+ 'adb-log-filtering' ,
1582+ ]),
1583+ );
1584+
1585+ final verboseCommand = AttachCommand (
1586+ buildSystem: buildSystem,
1587+ buildTargets: const BuildTargetsImpl (),
1588+ xcode: null ,
1589+ toolContext: createToolContext (),
1590+ verboseHelp: true ,
1591+ );
1592+ final hiddenInVerboseMode = < String > {
1593+ for (final entry in verboseCommand.argParser.options.entries)
1594+ if (entry.value.hide) entry.key,
1595+ };
1596+ expect (hiddenInVerboseMode, isEmpty);
1597+ });
15201598 });
15211599}
15221600
0 commit comments