MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / createSortedHelpConfig

Function createSortedHelpConfig

src/main.tsx:1072–1081  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1070 // Commander supports compareOptions at runtime but @commander-js/extra-typings
1071 // doesn't include it in the type definitions, so we use Object.assign to add it.
1072 function createSortedHelpConfig(): {
1073 sortSubcommands: true;
1074 sortOptions: true;
1075 } {
1076 const getOptionSortKey = (opt: Option): string =>
1077 opt.long?.replace(/^--/, '') ?? opt.short?.replace(/^-/, '') ?? '';
1078 return Object.assign({ sortSubcommands: true, sortOptions: true } as const, {
1079 compareOptions: (a: Option, b: Option) => getOptionSortKey(a).localeCompare(getOptionSortKey(b)),
1080 });
1081 }
1082 const program = new CommanderCommand().configureHelp(createSortedHelpConfig()).enablePositionalOptions();
1083 profileCheckpoint('run_commander_initialized');
1084

Callers 1

runFunction · 0.85

Calls 1

getOptionSortKeyFunction · 0.85

Tested by

no test coverage detected