Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add `--aliases` flag for readme command * fix: create test fixture to test --no-aliases flag * fix: eslint issues Co-authored-by: Shazron Abdullah <36107+shazron@users.noreply.github.com>
- Loading branch information
1 parent
c473b20
commit 5bf2b5a
Showing
8 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# cli-command-with-alias | ||
|
||
This file is a test for running `oclif-dev readme` with aliases. If the --no-aliases flag | ||
is passed as a flag, no aliases should be in the README. | ||
|
||
<!-- toc --> | ||
<!-- tocstop --> | ||
|
||
# Usage | ||
|
||
<!-- usage --> | ||
<!-- usagestop --> | ||
|
||
# Commands | ||
|
||
<!-- commands --> | ||
<!-- commandsstop --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "cli-command-with-alias", | ||
"files": [ | ||
"/lib" | ||
], | ||
"oclif": { | ||
"commands": "./lib/commands", | ||
"bin": "oclif", | ||
"helpClass": "./lib/help" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test/fixtures/cli-command-with-alias/src/commands/hello.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Command} from '@oclif/core' | ||
|
||
export default class Hello extends Command { | ||
static description = 'a simple command' | ||
|
||
static flags = {} | ||
|
||
static aliases = ['hi'] | ||
|
||
async run(): Promise<void> { | ||
this.log('hello world') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {Interfaces, Help} from '@oclif/core' | ||
|
||
export default class CustomHelp extends Help { | ||
formatCommand(command: Interfaces.Command): string { | ||
return `Custom help for ${command.id}` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {run} from '@oclif/core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"importHelpers": true, | ||
"module": "commonjs", | ||
"outDir": "lib", | ||
"rootDir": "src", | ||
"strict": true, | ||
"target": "es2017" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters