aboutsummaryrefslogtreecommitdiffstats
path: root/argparse.c
diff options
context:
space:
mode:
authorPA4WDH2023-05-27 11:20:22 +0200
committerPA4WDH2023-05-27 11:20:22 +0200
commitb80926797863c5a36417eb44a34483bb93610b79 (patch)
tree1a5026e03db338b86671ffe8d556fb57cb3529f0 /argparse.c
parentUse CPU Transition Latency as checkdelay when setting new scaling_max_freq (diff)
downloadcputemp2maxfreq-b80926797863c5a36417eb44a34483bb93610b79.tar.gz
cputemp2maxfreq-b80926797863c5a36417eb44a34483bb93610b79.tar.bz2
cputemp2maxfreq-b80926797863c5a36417eb44a34483bb93610b79.zip
Add feature to use unixtime timestamps in logs and CSV
Diffstat (limited to 'argparse.c')
-rw-r--r--argparse.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/argparse.c b/argparse.c
index 75ca20d..5c834cc 100644
--- a/argparse.c
+++ b/argparse.c
@@ -32,7 +32,9 @@ void printhelp()
"-s <step> Step size in Khz when increasing/decreasing CPU speed\n"
" Default: %ld\n"
"-t <number> Temperature limit\n"
- " Default: %ld\n",
+ " Default: %ld\n"
+ "-u Use unixtime timestamps in log and CSV outputs\n"
+ " Default timestamp format is: YYYY-MM-DD HH:MM:SS\n",
config.name,config.fallback_freq,config.governor,config.temp_input,config.logger_name,
config.interval,config.freq_step,config.max_temp/1000
);
@@ -59,7 +61,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:"))!=-1)
+ while((opt=getopt(argc,argv,"c:C:f:g:hi:l:mp:s:t:u"))!=-1)
{
DEBUG1_ARGPARSE("Argument: %c Value: %s\n",opt,optarg);
switch(opt)
@@ -99,6 +101,9 @@ void argparse(int argc, char **argv)
case 't':
userconfig.max_temp=strtoll(optarg,NULL,10)*1000;
break;
+ case 'u':
+ userconfig.use_unixtime=1;
+ break;
default:
printhelp();
exit(1);