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