Skip to content

Commit

Permalink
Update demo scripts to commander 12
Browse files Browse the repository at this point in the history
  • Loading branch information
yo35 committed Mar 10, 2024
1 parent 511a1f0 commit 666acc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/movegeneration.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


const { Position } = require('../dist/lib/index');
const program = require('commander');
const { program } = require('commander');


function align(data, width) {
Expand Down
8 changes: 3 additions & 5 deletions demo/pgnparsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const { exception, pgnRead } = require('../dist/lib/index');
const fs = require('fs');
const program = require('commander');
const { program } = require('commander');


function alignLeft(data, width) {
Expand Down Expand Up @@ -128,10 +128,8 @@ function run(paths, pathAlignment) {
// -----------------------------------------------------------------------------

program
.arguments('<pgn-files...>')
.description('Analyze some PGN files', {
'pgn-files': 'path to the PGN files to analyse'
})
.argument('<pgn-files...>', 'path to the PGN files to analyse')
.description('Analyze some PGN files')
.parse(process.argv);

const pathAlignment = program.args.map(path => path.length).reduce((l1, l2) => Math.max(l1, l2));
Expand Down

0 comments on commit 666acc5

Please sign in to comment.