mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-30 01:23:01 +00:00
17 lines
399 B
TypeScript
17 lines
399 B
TypeScript
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;
|
|
};
|