Commit aea8b22decffc3d2d6d330609d45a54c8fbe3c8b
Merge branches 'collaborate' and 'require-name'
Charles Lehner committed on 10/6/2016, 8:49:36 PMParent: 46afa90a83a8c220adc40fb5ae4f23fda9156e70
Parent: 976247c27be1b03518c4398932709648836fb5a6
Files changed
bin.js | changed |
bin.js | |||
---|---|---|---|
@@ -29,9 +29,9 @@ | |||
29 | 29 … | return version() | |
30 | 30 … | ||
31 | 31 … | switch (cmd) { | |
32 | 32 … | case 'create': | |
33 | - return createRepo(config, config._[0] || 'ssb', config._[1]) | ||
33 … | + return createRepo(config, config._[0], config._[1]) | ||
34 | 34 … | case 'fork': | |
35 | 35 … | return forkRepo(config) | |
36 | 36 … | case 'forks': | |
37 | 37 … | return require('./lib/forks')(config) | |
@@ -83,15 +83,15 @@ | |||
83 | 83 … | 'Options:', | |
84 | 84 … | ' command Command to get help with') | |
85 | 85 … | case 'create': | |
86 | 86 … | return out( | |
87 | - 'Usage: ' + prog + ' create [<remote> [<name>]]', | ||
87 … | + 'Usage: ' + prog + ' create <remote> [<name>]', | ||
88 | 88 … | '', | |
89 | 89 … | ' Create a new git-ssb repo and add it as a git remote', | |
90 | 90 … | '', | |
91 | 91 … | 'Arguments:', | |
92 | - ' remote Name of the remote to add. default: \'ssb\'', | ||
93 | - ' name Name to give the repo on ssb, if any') | ||
92 … | + ' remote Name of the remote to add. e.g. \'origin\' or \'ssb\'', | ||
93 … | + ' name Name to give the repo, if any') | ||
94 | 94 … | case 'fork': | |
95 | 95 … | return out( | |
96 | 96 … | 'Usage: ' + prog + ' fork [<upstream>] <remote_name>', | |
97 | 97 … | '', | |
@@ -171,8 +171,10 @@ | |||
171 | 171 … | return !!~remotes.indexOf(name) | |
172 | 172 … | } | |
173 | 173 … | ||
174 | 174 … | function createRepo(config, remoteName, name, upstream) { | |
175 … | + if (config._.length == 0) return help('create') | ||
176 … | + if (!remoteName) err(1, 'Missing remote name') | ||
175 | 177 … | if (hasRemote(remoteName)) | |
176 | 178 … | err(1, 'Remote \'' + remoteName + '\' already exists') | |
177 | 179 … | u.getSbot(config, function (err, sbot) { | |
178 | 180 … | if (err) throw err |
Built with git-ssb-web