This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
52 lines (42 loc) · 1.76 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 cli = require('./cli')
const server = require('./server')
const pkg = require('./package.json')
const program = require('commander')
program
.version(pkg.version)
program
.command('start')
.description('Start the Jackal server')
.option('-c, --config-path [configPath]', 'Pass a path to a config file, default ./jackal.json')
.action(server)
program
.command('send <jackalUrl> <contractsPath>')
.option('-r, --reporter [reporter]', 'Reporter for output [json|spec|teamcity]')
.option('--skip-missing-contract', 'Do not execute tests if the contracts file is missing')
.description('Send the consumer\'s contracts in the specified file to the Jackal service')
.action(cli.send)
program
.command('run <jackalUrl> <providerName>')
.option('-r, --reporter [reporter]', 'Reporter for output [json|spec|teamcity]')
.option('-p, --provider-url [providerUrl]', 'Base url of the provider, defaults to the original URL specified by the consumer contract')
.description('Runs the provider\'s contracts stored in the database of the Jackal service')
.action(cli.run)
program
.command('dump <jackalUrl>')
.option('-r, --reporter [reporter]', 'Reporter for output [json|pretty]')
.description('Dumps the database of the Jackal service')
.action(cli.dump)
program
.command('stats <jackalUrl>')
.option('-c, --consumer [consumer]', 'Consumer to retrieve current statistics for')
.option('-p, --provider [provider]', 'Provider to retrieve current statistics for')
.option('-r, --reporter [reporter]', 'Reporter for output [json|pretty]')
.description('Gets usage stats from the running Jackal service')
.action(cli.stats)
program
.parse(process.argv)
if (!process.argv.slice(2).length) {
program.outputHelp()
}