UNPKG

891 BJavaScriptView Raw
1var cmds = require('./cmds')
2
3exports.help = `
4Usage: git ssb [--version] [command] [--help]
5
6Commands:
7 create Create a git repo on SSB
8 fork Fork a git repo on SSB
9 forks List forks of a repo
10 issues List issues for a repo
11 prs List pull requests for a repo
12 authors List contributors to a repo
13 log List history of updates to a repo
14 name Name a repo
15 pull-request Create a pull-request
16 web Serve a web server for repos
17 help Get help about a command
18`
19
20exports.fn = function (argv) {
21 if (argv.version) return require('./version')(argv)
22 if (argv.help) return require('./help').fn(argv)
23 if (argv._.length === 0) return require('./help').fn(argv)
24
25 var cmd = argv._.shift()
26 var mod = cmds.getCmd(cmd)
27 var fn = mod && mod.fn
28 if (!fn) throw `No such command '${cmd}'`
29 fn(argv)
30}