Skip to content

Commit fddb614

Browse files
authored
feat(help): typos, add rdme version (#493)
* fix: typo in initial screen 😞 * feat: add rdme version to initial help screen This means I had to remove some snapshot tests in favor of partial match testing... feels bad but don't really know how to test dynamic things like versions via snapshots 😭
1 parent 90b7a43 commit fddb614

File tree

5 files changed

+5
-151
lines changed

5 files changed

+5
-151
lines changed

__tests__/__snapshots__/index.test.js.snap

Lines changed: 0 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -24,152 +24,6 @@ Related commands
2424
"
2525
`;
2626

27-
exports[`cli --help should print help 1`] = `
28-
"
29-
📖 rdme
30-
31-
a utlity for interacting with ReadMe
32-
.
33-
.\\\\ /.
34-
’ ‘ ‘ ‘
35-
( nn\\\\ . . / )
36-
(nnnnn,.MM. AM .nn.
37-
.nnnndMM----_______--M.’’ /
38-
|nnn/nnnnnnnnnnnnnnnnn\\\\’mmm/
39-
/nnnn...nnnnnnnnnnn...mmmmm\\\\
40-
/nn ‘qnnnP’ ‘mmm\\\\
41-
/n’ .XXX. \\\\nnn/ .XX. \\\\mmb
42-
An (XOXX) nnn (XOXX) mm\\\\
43-
/nn ‘XXXX’.~”~. ‘XXX”’ .mmmb
44-
dnnn. ( )n. .mmmmb
45-
.nnnnnn....n.\\\\ ./nnnnnnnnnmmmmmm\\\\
46-
(READnnnnnnnnnnn’Y’nnnnnnnnnnmmmmmmME)
47-
REinnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmAD/
48-
/MEEnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmm)E'.
49-
READnnnnnnn*’ ‘*mmmmmmmm)MEE.
50-
(READ|nnnn’ \\\\../ \\\\.../ ‘mmmmmM)EEE)
51-
READ(nn*’ ‘mmm.MEEE)
52-
‘READn’ \\\\._./ \\\\__./ \\\\.../ ‘MEE*’
53-
* /*
54-
55-
Usage
56-
57-
rdme <command> [arguments]
58-
59-
Options
60-
61-
-h, --help Display this usage guide
62-
-v, --version Show the current rdme version
63-
64-
Administration
65-
66-
$ rdme login Login to a ReadMe project.
67-
$ rdme logout Logs the currently authenticated user out of ReadMe.
68-
$ rdme whoami Displays the current user and project authenticated with ReadMe.
69-
70-
Upload OpenAPI/Swagger definitions
71-
72-
$ rdme openapi Upload, or resync, your OpenAPI/Swagger definition to ReadMe.
73-
$ rdme validate Validate your OpenAPI/Swagger definition.
74-
$ rdme swagger Alias for \`rdme openapi\`. [deprecated]
75-
76-
Documentation
77-
78-
$ rdme docs Sync a folder of markdown files to your ReadMe project.
79-
$ rdme docs:edit Edit a single file from your ReadMe project without saving locally.
80-
81-
Versions
82-
83-
$ rdme versions List versions available in your project or get a version by SemVer
84-
(https://semver.org/).
85-
$ rdme versions:create Create a new version for your project.
86-
$ rdme versions:update Update an existing version for your project.
87-
$ rdme versions:delete Delete a version associated with your ReadMe project.
88-
89-
Other useful commands
90-
91-
$ rdme oas Helpful OpenAPI generation tooling. [inactive]
92-
$ rdme open Open your current ReadMe project in the browser.
93-
94-
Run rdme help <command> for help with a specific command.
95-
96-
To get more help with ReadMe, check out our docs at https://docs.readme.com.
97-
"
98-
`;
99-
100-
exports[`cli --help should print help for the \`-H\` alias 1`] = `
101-
"
102-
📖 rdme
103-
104-
a utlity for interacting with ReadMe
105-
.
106-
.\\\\ /.
107-
’ ‘ ‘ ‘
108-
( nn\\\\ . . / )
109-
(nnnnn,.MM. AM .nn.
110-
.nnnndMM----_______--M.’’ /
111-
|nnn/nnnnnnnnnnnnnnnnn\\\\’mmm/
112-
/nnnn...nnnnnnnnnnn...mmmmm\\\\
113-
/nn ‘qnnnP’ ‘mmm\\\\
114-
/n’ .XXX. \\\\nnn/ .XX. \\\\mmb
115-
An (XOXX) nnn (XOXX) mm\\\\
116-
/nn ‘XXXX’.~”~. ‘XXX”’ .mmmb
117-
dnnn. ( )n. .mmmmb
118-
.nnnnnn....n.\\\\ ./nnnnnnnnnmmmmmm\\\\
119-
(READnnnnnnnnnnn’Y’nnnnnnnnnnmmmmmmME)
120-
REinnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmAD/
121-
/MEEnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmm)E'.
122-
READnnnnnnn*’ ‘*mmmmmmmm)MEE.
123-
(READ|nnnn’ \\\\../ \\\\.../ ‘mmmmmM)EEE)
124-
READ(nn*’ ‘mmm.MEEE)
125-
‘READn’ \\\\._./ \\\\__./ \\\\.../ ‘MEE*’
126-
* /*
127-
128-
Usage
129-
130-
rdme <command> [arguments]
131-
132-
Options
133-
134-
-h, --help Display this usage guide
135-
-v, --version Show the current rdme version
136-
137-
Administration
138-
139-
$ rdme login Login to a ReadMe project.
140-
$ rdme logout Logs the currently authenticated user out of ReadMe.
141-
$ rdme whoami Displays the current user and project authenticated with ReadMe.
142-
143-
Upload OpenAPI/Swagger definitions
144-
145-
$ rdme openapi Upload, or resync, your OpenAPI/Swagger definition to ReadMe.
146-
$ rdme validate Validate your OpenAPI/Swagger definition.
147-
$ rdme swagger Alias for \`rdme openapi\`. [deprecated]
148-
149-
Documentation
150-
151-
$ rdme docs Sync a folder of markdown files to your ReadMe project.
152-
$ rdme docs:edit Edit a single file from your ReadMe project without saving locally.
153-
154-
Versions
155-
156-
$ rdme versions List versions available in your project or get a version by SemVer
157-
(https://semver.org/).
158-
$ rdme versions:create Create a new version for your project.
159-
$ rdme versions:update Update an existing version for your project.
160-
$ rdme versions:delete Delete a version associated with your ReadMe project.
161-
162-
Other useful commands
163-
164-
$ rdme oas Helpful OpenAPI generation tooling. [inactive]
165-
$ rdme open Open your current ReadMe project in the browser.
166-
167-
Run rdme help <command> for help with a specific command.
168-
169-
To get more help with ReadMe, check out our docs at https://docs.readme.com.
170-
"
171-
`;
172-
17327
exports[`cli --help should print usage for a given command 1`] = `
17428
"
17529
Upload, or resync, your OpenAPI/Swagger definition to ReadMe.

__tests__/bin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('bin', () => {
99

1010
await new Promise(done => {
1111
exec(`node ${__dirname}/../bin/rdme`, (error, stdout) => {
12-
expect(stdout).toContain('a utlity for interacting with ReadMe');
12+
expect(stdout).toContain('a utility for interacting with ReadMe');
1313
done();
1414
});
1515
});

__tests__/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ describe('cli', () => {
6161
});
6262

6363
it('should print help', async () => {
64-
await expect(cli(['--help'])).resolves.toMatchSnapshot();
64+
await expect(cli(['--help'])).resolves.toContain('a utility for interacting with ReadMe');
6565
});
6666

6767
it('should print help for the `-H` alias', async () => {
68-
await expect(cli(['-H'])).resolves.toMatchSnapshot();
68+
await expect(cli(['-H'])).resolves.toContain('a utility for interacting with ReadMe');
6969
});
7070

7171
it('should print usage for a given command', async () => {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = processArgv => {
3434
name: 'version',
3535
alias: 'v',
3636
type: Boolean,
37-
description: `Show the current ${config.get('cli')} version`,
37+
description: `Show the current ${config.get('cli')} version (v${version})`,
3838
},
3939
{ name: 'command', type: String, defaultOption: true },
4040
];

src/lib/help.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const owlbert = () => {
1818
// http://asciiart.club
1919
return ` 📖 ${chalk.blue.bold(config.get('cli'))}
2020
21-
${chalk.bold(`a utlity for interacting with ReadMe`)}
21+
${chalk.bold(`a utility for interacting with ReadMe`)}
2222
.
2323
.\\\\ /.
2424
’ ‘ ‘ ‘

0 commit comments

Comments
 (0)