11import commandLineArgs from 'command-line-args' ;
22import commandLineUsage from 'command-line-usage' ;
33import { CommandLineArgs } from 'uhk-common' ;
4+ import { assertCommandLineOptions } from 'uhk-usb' ;
45
56const optionDefinitions : commandLineArgs . OptionDefinition [ ] = [
67 { name : 'devtools' , type : Boolean } ,
@@ -9,14 +10,18 @@ const optionDefinitions: commandLineArgs.OptionDefinition[] = [
910 { name : 'log' , type : String } ,
1011 { name : 'modules' , type : Boolean } ,
1112 { name : 'help' , type : Boolean } ,
13+ { name : 'pid' , type : Number } ,
1214 { name : 'preserve-udev-rules' , type : Boolean } ,
1315 { name : 'print-usb-devices' , type : Boolean } ,
1416 { name : 'reenumerate-and-exit' , type : String } ,
1517 { name : 'spe' , type : Boolean } , // simulate privilege escalation error
16- { name : 'usb-non-blocking' , type : Boolean }
18+ { name : 'usb-interface' , type : Number } ,
19+ { name : 'usb-non-blocking' , type : Boolean } ,
20+ { name : 'vid' , type : Number } ,
1721] ;
1822
1923export const options : CommandLineArgs = commandLineArgs ( optionDefinitions , { partial : true } ) as CommandLineArgs ;
24+ assertCommandLineOptions ( options ) ;
2025
2126const sections : commandLineUsage . Section [ ] = [
2227 {
@@ -51,6 +56,11 @@ const sections: commandLineUsage.Section[] = [
5156 description : 'Make the modules menu visible' ,
5257 type : Boolean
5358 } ,
59+ {
60+ name : 'pid' ,
61+ description : 'Use the specified USB product id. If you set it you have to set the vid and usb-interface too.' ,
62+ type : Number
63+ } ,
5464 {
5565 name : 'preserve-udev-rules' ,
5666 description : 'Don\'t force udev rule update' ,
@@ -73,10 +83,20 @@ const sections: commandLineUsage.Section[] = [
7383 description : 'Simulate privilege escalation error' ,
7484 type : Boolean
7585 } ,
86+ {
87+ name : 'usb-interface' ,
88+ description : 'Use the specified USB interface id. If you set it you have to set the vid and pid too.' ,
89+ type : Number
90+ } ,
7691 {
7792 name : 'usb-non-blocking' ,
7893 description : 'Use USB non-blocking communication' ,
7994 type : Boolean
95+ } ,
96+ {
97+ name : 'vid' ,
98+ description : 'Use the specified USB vendor id. If you set it you have to set the pid and usb-interface too.' ,
99+ type : Number
80100 }
81101 ]
82102 }
0 commit comments