Skip to content

Commit

Permalink
Merge pull request #48 from marp-team/preview-shorthand-option
Browse files Browse the repository at this point in the history
Add -p alias to --preview option
  • Loading branch information
yhatt authored Dec 20, 2018
2 parents 05f6b3b + 31f6fa4 commit 71a824a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Added

- Support `--preview` option in regular conversion and multiple files ([#47](https://github.com/marp-team/marp-cli/pull/47))
- Add `-p` alias to `--preview` option ([#48](https://github.com/marp-team/marp-cli/pull/48))

## v0.0.15 - 2018-12-06

Expand Down
1 change: 1 addition & 0 deletions src/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default async function(argv: string[] = []): Promise<number> {
? {}
: {
preview: {
alias: 'p',
describe: 'Open preview window (EXPERIMENTAL)',
group: OptionGroup.Basic,
type: 'boolean',
Expand Down
4 changes: 2 additions & 2 deletions test/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ describe('Marp CLI', () => {
})
})

context('with --preview option', () => {
context('with --preview / -p option', () => {
let warn: jest.SpyInstance<Console['warn']>

beforeEach(() => {
Expand All @@ -616,7 +616,7 @@ describe('Marp CLI', () => {
})

it('opens preview window through Preview.open()', async () => {
await marpCli([onePath, '--preview', '-o', '-'])
await marpCli([onePath, '-p', '-o', '-'])
expect(Preview.prototype.open).toBeCalledTimes(1)

// Simualte opening event
Expand Down

0 comments on commit 71a824a

Please sign in to comment.