Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.13 KB

README.md

File metadata and controls

65 lines (51 loc) · 1.13 KB

which one

List the scripts in package.json and choose one to execute.

Read this in other languages: English | 简体中文

Install

npm install -D @oasis-cloud/which-one

Example

└─> wo 
? which one › - Use arrow-keys. Return to submit.
❯   test
    color

or

└─> wo c
? which one › - Use arrow-keys. Return to submit.
❯   color
    demo:c

If only one script exists after filtering scripts, it is executed directly.

└─> wo color

Regular Filtering

Regular matching is filtered using global matching that ignores case.

│which-one on  main 
└─> wo c
? which one › - Use arrow-keys. Return to submit.
❯   color
│which-one on  main 
└─> wo 'd.*:c'
? which one › - Use arrow-keys. Return to submit.
❯   demo:c

Options

-r

Supports the -r option, which executes the previous script.

│which-one on  main 
└─> wo 'd.*:c'
? which one › - Use arrow-keys. Return to submit.
❯   demo:c

# will execute demo:c

│which-one on  main 
└─> wo -r