Skip to content

Commit

Permalink
Rename the project from opn-cli to open-cli
Browse files Browse the repository at this point in the history
And the binary from `opn` to `open-cli`.
  • Loading branch information
sindresorhus committed May 13, 2019
1 parent edb1e70 commit e9ad82c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
18 changes: 9 additions & 9 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ const fileType = require('file-type');

const cli = meow(`
Usage
$ opn <file|url> [--wait] [--background] [-- <app> [args]]
$ cat <file> | opn [--ext] [--wait] [--background] [-- <app> [args]]
$ open-cli <file|url> [--wait] [--background] [-- <app> [args]]
$ cat <file> | open-cli [--ext] [--wait] [--background] [-- <app> [args]]
Options
--wait Wait for the app to exit
--background Do not bring the app to the foreground (macOS only)
--ext File extension for when stdin file type can't be detected
Examples
$ opn https://sindresorhus.com
$ opn https://sindresorhus.com -- firefox
$ opn https://sindresorhus.com -- 'google chrome' --incognito
$ opn unicorn.png
$ cat unicorn.png | opn
$ echo '<h1>Unicorns!</h1>' | opn --ext=html
$ open-cli https://sindresorhus.com
$ open-cli https://sindresorhus.com -- firefox
$ open-cli https://sindresorhus.com -- 'google chrome' --incognito
$ open-cli unicorn.png
$ cat unicorn.png | open-cli
$ echo '<h1>Unicorns!</h1>' | open-cli --ext=html
`, {
flags: {
wait: {
Expand Down Expand Up @@ -55,6 +55,6 @@ if (input) {
const stdin = await getStdin.buffer();
const type = fileType(stdin);
const ext = cli.flags.ext || (type && type.ext) || 'txt';
open(tempWrite.sync(stdin, `opn.${ext}`), cli.flags);
open(tempWrite.sync(stdin, `open.${ext}`), cli.flags);
})();
}
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "opn-cli",
"name": "open-cli",
"version": "4.1.0",
"description": "Open stuff like URLs, files, executables. Cross-platform.",
"license": "MIT",
"repository": "sindresorhus/opn-cli",
"repository": "sindresorhus/open-cli",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bin": {
"opn": "cli.js"
"open-cli": "cli.js"
},
"engines": {
"node": ">=8"
Expand All @@ -26,7 +26,6 @@
"cli",
"app",
"open",
"opn",
"opener",
"opens",
"launch",
Expand All @@ -42,7 +41,6 @@
"url",
"urls",
"arguments",
"args",
"spawn",
"exec",
"child",
Expand All @@ -51,11 +49,11 @@
"file"
],
"dependencies": {
"file-type": "^10.10.0",
"get-stdin": "^6.0.0",
"file-type": "^11.0.0",
"get-stdin": "^7.0.0",
"meow": "^5.0.0",
"open": "^6.1.0",
"temp-write": "^3.4.0"
"open": "^6.3.0",
"temp-write": "^4.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
Expand Down
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# opn-cli [![Build Status](https://travis-ci.org/sindresorhus/opn-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/opn-cli)
# open-cli [![Build Status](https://travis-ci.org/sindresorhus/open-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/open-cli)

> Open stuff like URLs, files, executables. Cross-platform.

## Install

```
$ npm install --global opn-cli
$ npm install --global open-cli
```


## Usage

```
$ opn --help
$ open-cli --help
Usage
$ opn <file|url> [--wait] [--background] [-- <app> [args]]
$ cat <file> | opn [--ext] [--wait] [--background] [-- <app> [args]]
$ open-cli <file|url> [--wait] [--background] [-- <app> [args]]
$ cat <file> | open-cli [--ext] [--wait] [--background] [-- <app> [args]]
Options
--wait Wait for the app to exit
--background Do not bring the app to the foreground (macOS only)
--ext File extension for when stdin file type can't be detected
Examples
$ opn https://sindresorhus.com
$ opn https://sindresorhus.com -- firefox
$ opn https://sindresorhus.com -- 'google chrome' --incognito
$ opn unicorn.png
$ cat unicorn.png | opn
$ echo '<h1>Unicorns!</h1>' | opn --ext=html
$ open-cli https://sindresorhus.com
$ open-cli https://sindresorhus.com -- firefox
$ open-cli https://sindresorhus.com -- 'google chrome' --incognito
$ open-cli unicorn.png
$ cat unicorn.png | open-cli
$ echo '<h1>Unicorns!</h1>' | open-cli --ext=html
```

The [following file types](https://github.com/sindresorhus/file-type#supported-file-types) are automagically detected when using stdin mode.
Expand Down

0 comments on commit e9ad82c

Please sign in to comment.