Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 17, 2015
1 parent 6d6cfef commit 7db7d9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
8 changes: 1 addition & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var objectAssign = require('object-assign');
var Pageres = require('pageres');
var parseHeaders = require('parse-headers');
var meow = require('meow');
var pkg = require('./package.json');

var options = {
boolean: [
Expand Down Expand Up @@ -43,16 +42,13 @@ var cli = meow(multiline(function () {
pageres <url> <resolution>
pageres [ <url> <resolution> ] [ <url> <resolution> ]
pageres [ <url> <resolution> ... ] < <file>
cat <file> | pageres [ <url> <resolution> ... ]
Example
pageres todomvc.com yeoman.io 1366x768 1600x900
pageres [ yeoman.io 1366x768 1600x900 --no-crop ] [ todomvc.com 1024x768 480x320 ] --crop
pageres todomvc.com 1024x768 --filename='<%= date %> - <%= url %>'
pageres yeoman.io 1366x768 --selector='.page-header'
pageres --delay 3 1366x768 < urls.txt
pageres unicorn.html 1366x768
cat screen-resolutions.txt | pageres todomvc.com yeoman.io
Options
-v, --verbose Verbose output
Expand All @@ -69,8 +65,6 @@ var cli = meow(multiline(function () {
--format=<string> Image format
<url> can also be a local file path.
You can also pipe in a newline separated list of urls and screen resolutions which will get merged with the arguments.
*/}), options);

function generate(args, options) {
Expand Down Expand Up @@ -200,6 +194,6 @@ function init(args, options) {
}

sudoBlock();
updateNotifier({pkg: pkg}).notify();
updateNotifier({pkg: cli.pkg}).notify();

init(subarg(cli.input, options)._, cli.flags);
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
"description": "Capture website screenshots",
"license": "MIT",
"repository": "sindresorhus/pageres-cli",
"preferGlobal": true,
"bin": {
"pageres": "cli.js"
},
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bin": {
"pageres": "cli.js"
},
"engines": {
"node": ">=0.12.0"
},
Expand Down Expand Up @@ -71,7 +70,7 @@
"devDependencies": {
"ava": "*",
"get-exec-file": "^1.0.0",
"path-exists": "^1.0.0",
"path-exists": "^2.1.0",
"xo": "*"
},
"xo": {
Expand Down
9 changes: 1 addition & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ pageres todomvc.com yeoman.io 1024x768 # 2 screenshots
pageres todomvc.com yeoman.io 1024x768 1366x768 # 4 screenshots
```

Pipe in a newline separated list of urls and screen resolutions which will get merged with the arguments.

```sh
# In this case a list of screen resolutions
pageres <url> < screen-resolutions.txt
```

Group arguments with square brackets.

```sh
Expand Down Expand Up @@ -200,7 +193,7 @@ You can use the most popular resolutions for your site with `pageres` by followi
- Click the `Screen Resolution` link in the middle of the screen
- Click the `Export` button at the top, then `Google Spreadsheets`, and select yes for importing
- Select all the resolutions and copy them into a new file and save it
- In your terminal run: `pageres website.com < file-from-above-step.txt`
- In your terminal run: `pageres website.com $(awk '{a = $1 " " a} END {print a}' file-from-above-step.txt)`


## License
Expand Down
6 changes: 2 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import pathExists from 'path-exists';
import execFile from 'get-exec-file';
import {version as pkgVersion} from '../package.json';

process.chdir(__dirname);

test.serial('generate screenshot', async t => {
test('generate screenshot', async t => {
await execFile('../cli.js', ['yeoman.io', '320x240']);

t.true(pathExists.sync('yeoman.io-320x240.png'));
Expand Down Expand Up @@ -54,5 +52,5 @@ test('show help screen', async t => {
test('show version', async t => {
const {stdout} = await execFile('../cli.js', ['--version']);

t.regexTest(new RegExp(pkgVersion), stdout)
t.is(stdout.trim(), pkgVersion);
});

0 comments on commit 7db7d9f

Please sign in to comment.