-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
executable file
·66 lines (55 loc) · 1.53 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env node
const {
install,
getPath,
removeLocation,
forgetUsages,
purge,
list,
edit,
add,
} = require('./src/cliActions')
const program = require('commander')
program.version(require('./package.json').version)
// command definitions
program
.command('list [query]')
.description(
"Lists all known locations. Searches them when providing 'query'",
)
.action(list)
program
.arguments('<name> [manipulator]')
.description(
'Output the location known under this name. If location not known, current working directory is returned.',
)
.action(getPath)
program
.command('rm <name>')
.description('Remove the location known under this name, if existing')
.action(removeLocation)
program
.command('forget')
.description('Forget usage statistics of all locations')
.action(forgetUsages)
program
.command('purge')
.description(
'Purges all bookmarks which do not have existing directories in the file system anymore',
)
.action(purge)
program
.command('install [shell]')
.description(
"Detects your shell and installs the goto command for it. If 'shell' parameter provided, installs command for this shell.",
)
.action(install)
program
.command('edit <name>')
.description('Edit the location known under this name')
.action(edit)
program
.command('add <name>')
.description('Add the currently visited location as known one under a name')
.action(add)
program.parse(process.argv)