Skip to content

Commit 19166ac

Browse files
committed
fix(fmt): align help option descriptions
1 parent 723dc5b commit 19166ac

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

packages/rstack/src/fmt/cli.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ ${color.yellow(' $ rs fmt [options] [files/globs...]')}
2626
Format files with Prettier.
2727
2828
${color.cyan('Options')}:
29-
--write Write formatted files in place (default)
30-
--check Check whether files are formatted
31-
--list-different Print paths of unformatted files
32-
--ignore-path <path> Path to an additional ignore file (repeatable)
29+
--write Write formatted files in place (default)
30+
--check Check whether files are formatted
31+
--list-different Print paths of unformatted files
32+
--ignore-path <path> Path to an additional ignore file (repeatable)
3333
--parallel-workers <count> Number of parallel workers
34-
--stdin-filepath <path> Format stdin as if it were saved at <path>
35-
-h, --help Display this help message`;
34+
--stdin-filepath <path> Format stdin as if it were saved at <path>
35+
-h, --help Display this help message`;
3636

3737
const parseMaxWorkers = (
3838
kebabValue: string | undefined,

packages/rstack/tests/fmt/cli.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,17 @@ test('rejects file arguments with --stdin-filepath', () => {
139139
});
140140

141141
test('provides command help', () => {
142-
expect(fmtHelpMessage).toContain('Usage:\n $ rs fmt [options] [files/globs...]');
143-
expect(fmtHelpMessage).toContain('--write');
144-
expect(fmtHelpMessage).toContain('--check');
145-
expect(fmtHelpMessage).toContain('--list-different');
146-
expect(fmtHelpMessage).toContain('--ignore-path <path>');
147-
expect(fmtHelpMessage).toContain('--parallel-workers <count>');
148-
expect(fmtHelpMessage).toContain('--stdin-filepath <path>');
149-
expect(fmtHelpMessage).toContain('-h, --help');
142+
const helpMessage = stripVTControlCharacters(fmtHelpMessage);
143+
144+
expect(helpMessage).toContain('Usage:\n $ rs fmt [options] [files/globs...]');
145+
expect(helpMessage).toContain(`Options:
146+
--write Write formatted files in place (default)
147+
--check Check whether files are formatted
148+
--list-different Print paths of unformatted files
149+
--ignore-path <path> Path to an additional ignore file (repeatable)
150+
--parallel-workers <count> Number of parallel workers
151+
--stdin-filepath <path> Format stdin as if it were saved at <path>
152+
-h, --help Display this help message`);
150153
});
151154

152155
test.each([

0 commit comments

Comments
 (0)