aboutsummaryrefslogtreecommitdiffstats
path: root/argparse.c
diff options
context:
space:
mode:
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);