2018-03-29 14:59:06 +09:00
|
|
|
import * as nopt from 'nopt';
|
2018-03-29 01:20:40 +09:00
|
|
|
|
|
|
|
export default (vector, index) => {
|
|
|
|
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;
|
|
|
|
};
|