-
Notifications
You must be signed in to change notification settings - Fork 30
/
cli.js
executable file
·50 lines (42 loc) · 1.87 KB
/
cli.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
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const router = require('./src/router');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
updateNotifier({ pkg }).notify();
const cli = meow(`
Usage
$ drone <command> <params>
$ drone install # Downloads the packages
$ drone test <library> # Tests the library by fetching its version
$ drone add <library> <module> # Adds a dependency to a module
$ drone remove <library> <module> # Removes the dependency from a module
$ drone info <library> # Retrieves the info for this package
$ drone update # Get the latest packages
$ drone list # List all of the packages
$ drone stats # Get some stats regarding the hive
$ drone hive # Opens the hive url
$ drone open <library> # Opens the library's homepage
$ drone search <library> # Searches for the 'library' in the hive
Examples
$ drone install # Downloads the packages
$ drone info picasso # Shows the info for picasso
$ drone add retrofit app # Adds retrofit to the 'app' module
$ drone rm retrofit app # removes retrofit from the 'app' module
$ drone open gson # Opens GSONs homepage
$ drone search rxjava # Searches the hive for 'rxjava'
$ drone test picasso # Tests the library by fetching its version
`,
{
alias: {
v: 'version'
},
boolean: ['version']
});
// todo missing HasFlag --version, -v
if (cli.input.length > 0) {
router.init(cli.input, cli.flags);
} else {
cli.showHelp(2);
}