Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
monokh committed Mar 28, 2019
0 parents commit cb31241
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "swap-diag",
"version": "1.0.0",
"description": "Atomic swap diagnostics tool",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Liquality",
"license": "MIT",
"dependencies": {
"commander": "^2.19.0",
"qs": "^6.7.0"
}
}
16 changes: 16 additions & 0 deletions src/cli-details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var program = require('commander');
var url = require('url')
var qs = require('qs')

program
.parse(process.argv);

var links = program.args;

if (links.length !== 1) {
console.error('link required');
process.exit(1);
}

const link = links[0]
console.log(qs.parse(url.parse(link).hash.replace('#', '')))
7 changes: 7 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var program = require('commander');

program
.version('1.0.0')
.description('Swap diagnostics')
.command('details [link]', 'Show swap details', { isDefault: true })
.parse(process.argv);
Empty file added src/index.js
Empty file.

0 comments on commit cb31241

Please sign in to comment.