@@ -353,7 +353,7 @@ int main(int argc, const char *argv[])
353
353
const char * defcsvcomma = csvcomma ;
354
354
poptContext popt ; // context for parsing command-line options
355
355
const struct poptOption optionsTable [] = {
356
- { "sql-conf" , 0 , POPT_ARGFLAG_SHOW_DEFAULT | POPT_ARG_STRING , & sqlconf , 0 , "Client config file" , "filename" },
356
+ { "sql-conf" , 0 , POPT_ARGFLAG_SHOW_DEFAULT | POPT_ARG_STRING , & sqlconf , 0 , "Client config file ($SQL_CNF_FILE) " , "filename" },
357
357
{ "sql-host" , 'h' , POPT_ARG_STRING , & sqlhost , 0 , "SQL server host" , "hostname/ip" },
358
358
{ "sql-port" , 0 , POPT_ARG_INT , & sqlport , 0 , "SQL server port" , "port" },
359
359
{
@@ -458,6 +458,9 @@ int main(int argc, const char *argv[])
458
458
if (expand && noexpand )
459
459
errx (1 , "Make your bloody mind up" );
460
460
461
+ if (!sqlconf )
462
+ sqlconf = getenv ("SQL_CNF_FILE" );
463
+
461
464
if (!expand )
462
465
sql_real_connect (& sql , sqlhost , sqluser , sqlpass , sqldatabase , sqlport , 0 , 0 , 1 , sqlconf );
463
466
0 commit comments