blob: 29e5959c3e4dd438a6e97f9641b4914af633c98a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import * as nopt from 'nopt';
export default (vector: any, index: any) => {
const parsed = nopt({
'only-processor': Boolean,
'only-server': Boolean
}, {
p: ['--only-processor'],
s: ['--only-server']
}, vector, index);
if (parsed['only-processor'] && parsed['only-server']) {
throw 'only-processor option and only-server option cannot be set at the same time';
}
return parsed;
};
|