diff options
Diffstat (limited to 'argparse.c')
-rw-r--r-- | argparse.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -30,6 +30,10 @@ void printhelp() " Default: Always set CPU to lowest frequency on exit\n" "-p <time> Poll interval in seconds\n" " Default: %d\n" + "-P <CPU ID> Physical CPU number (socket number) for multi-CPU systems. Given\n" + " a number it will only change the governor/frequency for the\n" + " given CPU, or the word \"all\" to change all CPU's\n" + " Default: all\n" "-s <step> Step size in Khz when increasing/decreasing CPU speed\n" " Default: %ld\n" "-t <number> Temperature limit\n" @@ -73,7 +77,7 @@ void argparse(int argc, char **argv) memcpy(&userconfig,&config,sizeof(struct s_config)); // Parse options - while((opt=getopt(argc,argv,"c:C:d:f:g:hi:kl:mp:s:t:u"))!=-1) + while((opt=getopt(argc,argv,"c:C:d:f:g:hi:kl:mp:P:s:t:u"))!=-1) { DEBUG1_ARGPARSE("Argument: %c Value: %s\n",opt,optarg); switch(opt) @@ -118,6 +122,14 @@ void argparse(int argc, char **argv) case 'p': userconfig.interval=strtoll(optarg,NULL,10); break; + case 'P': + if (strcmp(optarg,"all")==0) + { + userconfig.cpu=-1; + } else { + userconfig.cpu=strtoll(optarg,NULL,10); + } + break; case 's': userconfig.freq_step=strtoll(optarg,NULL,10); break; |