-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (44 loc) · 1.31 KB
/
index.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env node
'use strict';
const program = require('commander');
const git = require('./scripts/githelper');
const available_languages = {
'javascript': '.js',
'php': '.php',
'perl': '.prl',
'fortran': '.f',
'python': '.py',
'asp.net': '.aspx',
'lua': '.lua',
'f#': '.fs',
'fsharp': '.fs',
'html': '.html',
'go': '.go',
'java': '.java',
'c++': '.cpp',
'c': '.c'
};
const extension_picker = function (language) {
let extension;
if (!language) extension = 'javascript';
if (!available_languages[language]) extension = `.${language}`
else extension = available_languages[language]
return extension;
};
program
.version(require('./package.json').version);
program
.command('run [language]')
.alias('r')
.option('--noweekends', 'Include weekends?')
.option('--random', 'Skip days randomly')
.option('--even', 'Skip odd number days')
.option('--odd', 'Skip even number days')
.option('--days [number]', 'Specify number of days to make commits for')
.option('--powermode', 'Doubles the number of commits per day!')
.description('Runs Greybeard script for 400 days on set language (default JavaScript)')
.action((language, options) => {
let extension = extension_picker(language.toLowerCase());
git.rockon(extension, options);
});
program.parse(process.argv);