UNPKG

456 BJavaScriptView Raw
1#!/usr/bin/env node
2
3var size = require('./');
4var helpText = [
5 'Usage',
6 ' $ window-size',
7 '',
8 'Example',
9 ' $ window-size',
10 ' height: 40 ',
11 ' width : 145',
12 ''
13].join('\n');
14
15function showSize() {
16 console.log('height: ' + size.height);
17 console.log('width : ' + size.width);
18}
19
20switch (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}