(args: ReadonlyArray<string>)
| 1616 | const isHelpFlag = (value: string): boolean => HELP_FLAGS.has(value); |
| 1617 | |
| 1618 | const parseCallHelpArgs = (args: ReadonlyArray<string>): ParsedCallHelpArgs => { |
| 1619 | let baseUrl: string | undefined = undefined; |
| 1620 | let serverName: string | undefined = undefined; |
| 1621 | let scopeDir: string | undefined = undefined; |
| 1622 | let match: string | undefined = undefined; |
| 1623 | let limit: number | undefined = undefined; |
| 1624 | const pathParts: Array<string> = []; |
| 1625 | |
| 1626 | for (let index = 0; index < args.length; index += 1) { |
| 1627 | const token = args[index]; |
| 1628 | if (!token || isHelpFlag(token)) continue; |
| 1629 | |
| 1630 | if (token === "--base-url") { |
| 1631 | const value = args[index + 1]; |
| 1632 | if (!value) throw new Error("Missing value for --base-url"); |
| 1633 | baseUrl = value; |
| 1634 | index += 1; |
| 1635 | continue; |
| 1636 | } |
| 1637 | if (token.startsWith("--base-url=")) { |
| 1638 | baseUrl = token.slice("--base-url=".length); |
| 1639 | continue; |
| 1640 | } |
| 1641 | |
| 1642 | if (token === "--server") { |
| 1643 | const value = args[index + 1]; |
| 1644 | if (!value) throw new Error("Missing value for --server"); |
| 1645 | serverName = value; |
| 1646 | index += 1; |
| 1647 | continue; |
| 1648 | } |
| 1649 | if (token.startsWith("--server=")) { |
| 1650 | serverName = token.slice("--server=".length); |
| 1651 | continue; |
| 1652 | } |
| 1653 | |
| 1654 | if (token === "--scope") { |
| 1655 | const value = args[index + 1]; |
| 1656 | if (!value) throw new Error("Missing value for --scope"); |
| 1657 | scopeDir = value; |
| 1658 | index += 1; |
| 1659 | continue; |
| 1660 | } |
| 1661 | if (token.startsWith("--scope=")) { |
| 1662 | scopeDir = token.slice("--scope=".length); |
| 1663 | continue; |
| 1664 | } |
| 1665 | |
| 1666 | if (token === "--log-level") { |
| 1667 | const value = args[index + 1]; |
| 1668 | if (!value) throw new Error("Missing value for --log-level"); |
| 1669 | index += 1; |
| 1670 | continue; |
| 1671 | } |
| 1672 | if (token.startsWith("--log-level=")) { |
| 1673 | continue; |
| 1674 | } |
| 1675 |
no test coverage detected