1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| #!/usr/bin/env node
| 'use strict';
| var helpText = ['Usage',
| ' $ window-size',
| '',
| 'Example',
| ' $ window-size',
| ' height: 40 ',
| ' width : 145',
| ''].join('\n');
|
| function showSize () {
| var size = require('./');
| console.log('height: ' + size.height);
| console.log('width : ' + size.width);
| }
|
| if (process.argv.length > 2) {
| switch (process.argv[2]) {
| case 'help':
| case '--help':
| case '-h':
| console.log(helpText);
| break;
| default:
| showSize();
| }
| } else {
| showSize();
| }
|
|