MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / partitionOptions

Function partitionOptions

scripts/docs/src/generate-cli-docs.ts:218–238  ·  view source on GitHub ↗
(options: Option[])

Source from the content-addressed store, hash-verified

216}
217
218function partitionOptions(options: Option[]): {
219 flags: Option[];
220 valueOptions: Option[];
221} {
222 const flags: Option[] = [];
223 const valueOptions: Option[] = [];
224
225 options.forEach((option) => {
226 if (option.hidden) {
227 return;
228 }
229
230 if (option.required || option.optional) {
231 valueOptions.push(option);
232 } else {
233 flags.push(option);
234 }
235 });
236
237 return { flags, valueOptions };
238}
239
240function buildUsage(command: Command): string {
241 return command.createHelp().commandUsage(command).trim();

Callers 1

buildCommandSectionFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…