File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2-
3- const yargs = require ( 'yargs' ) ;
42const LargeFileDiff = require ( '../index.js' ) ;
53
6- const argv = yargs
7- . usage ( '$0 file1 file2' )
8- . help ( 'help' ) . alias ( 'help' , 'h' ) . describe ( 'h' , 'Show help.' )
9- . epilog ( 'Home page and docs: https://github.com/niiknow/text-file-diff' )
10- . demand ( 2 )
11- . argv ;
4+ const argv = process . argv ;
5+
6+ if ( argv . length < 4 ) {
7+ console . log ( '-: require two files as arguments' ) ;
8+ console . log ( 'usage: text-file-diff file1 file2\n' ) ;
9+ process . exit ( 1 ) ;
10+ }
1211
13- const file1 = argv . _ [ 0 ] ;
14- const file2 = argv . _ [ 1 ] ;
12+ const file1 = argv [ 2 ] ;
13+ const file2 = argv [ 3 ] ;
1514
1615const lfd = new LargeFileDiff ( {
1716 skipHeader : argv . skipHeader
Original file line number Diff line number Diff line change 11{
22 "name" : " text-file-diff" ,
3- "version" : " 1.0.5 " ,
3+ "version" : " 1.0.6 " ,
44 "description" : " line by line diff of two large files" ,
55 "license" : " MIT" ,
66 "repository" : " niiknow/text-file-diff" ,
2828 " compare-files"
2929 ],
3030 "dependencies" : {
31- "n-readlines" : " ^0.2.8" ,
32- "yargs" : " ^9.0.1"
31+ "n-readlines" : " ^0.2.8"
3332 },
3433 "devDependencies" : {
3534 "ava" : " ^0.20.0" ,
36- "nyc" : " ^11.0.0 " ,
35+ "nyc" : " ^11.4.1 " ,
3736 "xo" : " ^0.18.2"
3837 },
3938 "xo" : {
You can’t perform that action at this time.
0 commit comments