From b80926797863c5a36417eb44a34483bb93610b79 Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Sat, 27 May 2023 11:20:22 +0200 Subject: Add feature to use unixtime timestamps in logs and CSV --- argparse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'argparse.c') 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 size in Khz when increasing/decreasing CPU speed\n" " Default: %ld\n" "-t 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); -- cgit v1.2.3