(command: Command.Any, commandPath: ReadonlyArray<string>)
| 948 | /* ========================================================================== */ |
| 949 | |
| 950 | const makeCommandContext = (command: Command.Any, commandPath: ReadonlyArray<string>): CommandContext => { |
| 951 | const flagParams = extractFlagParams(command) |
| 952 | const inheritedFlagParams = extractContextFlagParams(command) |
| 953 | const inheritedNames = new Set(inheritedFlagParams.map((param) => param.name)) |
| 954 | return { |
| 955 | command, |
| 956 | commandPath, |
| 957 | flagRegistry: createFlagRegistry(flagParams), |
| 958 | inheritedFlagRegistry: createFlagRegistry(inheritedFlagParams), |
| 959 | localFlagNames: flagParams.filter((param) => !inheritedNames.has(param.name)).map((param) => param.name) |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | /** |
| 964 | * Scans a single command level, processing all tokens. |
no test coverage detected