diff options
Diffstat (limited to 'argparse.c')
-rw-r--r-- | argparse.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -14,6 +14,8 @@ void printhelp() "Usage: %s <options>\n" "\n" "Scaling options:\n" + "-d <delay> Transition latency in us or \"auto\" for autodetect\n" + " Default: auto\n" "-f <frequency> Fallback frequency in KHz, used when everything fails\n" " Default: %ld\n" "-g <governor> cpufreq governor to use, use \"keep\" to keep current governor\n" @@ -65,7 +67,7 @@ void argparse(int argc, char **argv) memcpy(&userconfig,&config,sizeof(struct s_config)); // Parse options - while((opt=getopt(argc,argv,"c:C:f:g:hi:l:mp:s:t:u"))!=-1) + while((opt=getopt(argc,argv,"c:C:d:f:g:hi:l:mp:s:t:u"))!=-1) { DEBUG1_ARGPARSE("Argument: %c Value: %s\n",opt,optarg); switch(opt) @@ -78,6 +80,14 @@ void argparse(int argc, char **argv) strncpy(userconfig.csvlog,optarg,sizeof(userconfig.csvlog)); userconfig.csvoverwrite=1; break; + case 'd': + if (strcmp("auto",optarg)==0) + { + userconfig.transition_latency=-1; + } else { + userconfig.transition_latency=strtoll(optarg,NULL,10); + } + break; case 'f': userconfig.fallback_freq=strtoll(optarg,NULL,10); break; |