Skip to content

Commit b2d3e8f

Browse files
committed
Update CLIs
1 parent a2775a0 commit b2d3e8f

File tree

15 files changed

+255
-224
lines changed
  • lib/node_modules/@stdlib/random/streams

15 files changed

+255
-224
lines changed

lib/node_modules/@stdlib/random/streams/minstd-shuffle/bin/cli

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -116,12 +104,15 @@ function main() {
116104
})
117105
});
118106

107+
// Get any provided command-line options:
108+
flags = cli.flags();
109+
if ( flags.help || flags.version ) {
110+
return;
111+
}
112+
119113
// Get the current working directory:
120114
dir = cwd();
121115

122-
// Get any provided command-line flags:
123-
flags = cli.flags();
124-
125116
opts = {};
126117
if ( flags.iter ) {
127118
opts.iter = parseInt( flags.iter, 10 );
@@ -178,6 +169,17 @@ function main() {
178169
onError( err, code || 1 );
179170
}
180171
}
172+
173+
/**
174+
* Callback invoked upon encountering an error.
175+
*
176+
* @private
177+
* @param {Error} error - error
178+
* @param {integer} [code] - exit code
179+
*/
180+
function onError( error, code ) {
181+
cli.error( error, code || 1 );
182+
}
181183
}
182184

183185
main();

lib/node_modules/@stdlib/random/streams/minstd/bin/cli

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -116,12 +104,16 @@ function main() {
116104
})
117105
});
118106

107+
// Get any provided command-line options:
108+
flags = cli.flags();
109+
if ( flags.help || flags.version ) {
110+
return;
111+
}
112+
119113
// Get the current working directory:
120114
dir = cwd();
121115

122116
// Get any provided command-line flags:
123-
flags = cli.flags();
124-
125117
opts = {};
126118
if ( flags.iter ) {
127119
opts.iter = parseInt( flags.iter, 10 );
@@ -178,6 +170,17 @@ function main() {
178170
onError( err, code || 1 );
179171
}
180172
}
173+
174+
/**
175+
* Callback invoked upon encountering an error.
176+
*
177+
* @private
178+
* @param {Error} error - error
179+
* @param {integer} [code] - exit code
180+
*/
181+
function onError( error, code ) {
182+
cli.error( error, code || 1 );
183+
}
181184
}
182185

183186
main();

lib/node_modules/@stdlib/random/streams/mt19937/bin/cli

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -116,12 +104,15 @@ function main() {
116104
})
117105
});
118106

107+
// Get any provided command-line options:
108+
flags = cli.flags();
109+
if ( flags.help || flags.version ) {
110+
return;
111+
}
112+
119113
// Get the current working directory:
120114
dir = cwd();
121115

122-
// Get any provided command-line flags:
123-
flags = cli.flags();
124-
125116
opts = {};
126117
if ( flags.iter ) {
127118
opts.iter = parseInt( flags.iter, 10 );
@@ -178,6 +169,17 @@ function main() {
178169
onError( err, code || 1 );
179170
}
180171
}
172+
173+
/**
174+
* Callback invoked upon encountering an error.
175+
*
176+
* @private
177+
* @param {Error} error - error
178+
* @param {integer} [code] - exit code
179+
*/
180+
function onError( error, code ) {
181+
cli.error( error, code || 1 );
182+
}
181183
}
182184

183185
main();

lib/node_modules/@stdlib/random/streams/negative-binomial/bin/cli

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -118,6 +106,12 @@ function main() {
118106
})
119107
});
120108

109+
// Get any provided command-line options:
110+
flags = cli.flags();
111+
if ( flags.help || flags.version ) {
112+
return;
113+
}
114+
121115
// Get the current working directory:
122116
dir = cwd();
123117

@@ -130,9 +124,6 @@ function main() {
130124
args[ 0 ] = parseFloat( args[ 0 ] );
131125
args[ 1 ] = parseFloat( args[ 1 ] );
132126

133-
// Get any provided command-line flags:
134-
flags = cli.flags();
135-
136127
opts = {};
137128
if ( flags.iter ) {
138129
opts.iter = parseInt( flags.iter, 10 );
@@ -186,6 +177,17 @@ function main() {
186177
onError( err, code || 1 );
187178
}
188179
}
180+
181+
/**
182+
* Callback invoked upon encountering an error.
183+
*
184+
* @private
185+
* @param {Error} error - error
186+
* @param {integer} [code] - exit code
187+
*/
188+
function onError( error, code ) {
189+
cli.error( error, code || 1 );
190+
}
189191
}
190192

191193
main();

lib/node_modules/@stdlib/random/streams/normal/bin/cli

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -118,6 +106,12 @@ function main() {
118106
})
119107
});
120108

109+
// Get any provided command-line options:
110+
flags = cli.flags();
111+
if ( flags.help || flags.version ) {
112+
return;
113+
}
114+
121115
// Get the current working directory:
122116
dir = cwd();
123117

@@ -130,9 +124,6 @@ function main() {
130124
args[ 0 ] = parseFloat( args[ 0 ] );
131125
args[ 1 ] = parseFloat( args[ 1 ] );
132126

133-
// Get any provided command-line flags:
134-
flags = cli.flags();
135-
136127
opts = {};
137128
if ( flags.iter ) {
138129
opts.iter = parseInt( flags.iter, 10 );
@@ -186,6 +177,17 @@ function main() {
186177
onError( err, code || 1 );
187178
}
188179
}
180+
181+
/**
182+
* Callback invoked upon encountering an error.
183+
*
184+
* @private
185+
* @param {Error} error - error
186+
* @param {integer} [code] - exit code
187+
*/
188+
function onError( error, code ) {
189+
cli.error( error, code || 1 );
190+
}
189191
}
190192

191193
main();

lib/node_modules/@stdlib/random/streams/pareto-type1/bin/cli

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ var randomStream = require( './../lib' );
3939

4040
// FUNCTIONS //
4141

42-
/**
43-
* Callback invoked upon encountering an error.
44-
*
45-
* @private
46-
* @param {Error} error - error
47-
* @param {integer} [code] - exit code
48-
*/
49-
function onError( error, code ) {
50-
process.exitCode = code || 1;
51-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
52-
}
53-
5442
/**
5543
* Callback invoked once a source stream ends.
5644
*
@@ -118,6 +106,12 @@ function main() {
118106
})
119107
});
120108

109+
// Get any provided command-line options:
110+
flags = cli.flags();
111+
if ( flags.help || flags.version ) {
112+
return;
113+
}
114+
121115
// Get the current working directory:
122116
dir = cwd();
123117

@@ -130,9 +124,6 @@ function main() {
130124
args[ 0 ] = parseFloat( args[ 0 ] );
131125
args[ 1 ] = parseFloat( args[ 1 ] );
132126

133-
// Get any provided command-line flags:
134-
flags = cli.flags();
135-
136127
opts = {};
137128
if ( flags.iter ) {
138129
opts.iter = parseInt( flags.iter, 10 );
@@ -186,6 +177,17 @@ function main() {
186177
onError( err, code || 1 );
187178
}
188179
}
180+
181+
/**
182+
* Callback invoked upon encountering an error.
183+
*
184+
* @private
185+
* @param {Error} error - error
186+
* @param {integer} [code] - exit code
187+
*/
188+
function onError( error, code ) {
189+
cli.error( error, code || 1 );
190+
}
189191
}
190192

191193
main();

0 commit comments

Comments
 (0)