#include "config_parse.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

extern char **environ;

/******************************************************************************/
int main(
    int argc,
    char *argv[]
)
{
    FILE * conf_fd;
    config_parse_res_t res;
    
    if(argc != 2)
    {
        printf("usage: config_parse file ('-' for stdin)\n");
        return EXIT_FAILURE;
    }
    
    if(0 == strcmp("-", argv[1]))
    {
        conf_fd = stdin;
    }
    else
    {
        conf_fd = fopen(argv[1], "r");
    }
    
    if(NULL != conf_fd)
    {
        res = config_parse(conf_fd, 1);
        if(CONFIG_PARSE_OK == res)
        {
            char **env;
            for (env = environ; *env; ++env)
                printf("%s\n", *env);
        }
        else
        {
            printf("Error no. %d while processing file \n", res);
        }
        
        fclose(conf_fd);
    }
    else
    {
        printf("Could not open the specified file.\n");
        return EXIT_FAILURE;
    }
    
    return EXIT_SUCCESS;
}

#include "config_parse.h"
#include <stdio.h>
#include <stdlib.h>

extern char **environ;

/******************************************************************************/
int main(
    int argc,
    char *argv[]
)
{
    FILE * conf_fd;
    config_parse_res_t res;
    
    if(argc != 2)
    {
        printf("usage: config_parse file\n");
        return EXIT_FAILURE;
    }
    
    conf_fd = fopen(argv[1], "r");
    
    if(NULL != conf_fd)
    {
        res = config_parse(conf_fd, 1);
        if(CONFIG_PARSE_OK == res)
        {
            char **env;
            for (env = environ; *env; ++env)
                printf("%s\n", *env);
        }
        else
        {
            printf("Error no. %d while processing file \n", res);
        }
        
        fclose(conf_fd);
    }
    else
    {
        printf("Could not open the specified file.\n");
        return EXIT_FAILURE;
    }
    
    return EXIT_SUCCESS;
}
--- 
+++ 
@@ -1,5 +1,6 @@
 #include "config_parse.h"
 #include <stdio.h>
+#include <string.h>
 #include <stdlib.h>
 
 extern char **environ;
@@ -15,11 +16,18 @@
     
     if(argc != 2)
     {
-        printf("usage: config_parse file\n");
+        printf("usage: config_parse file ('-' for stdin)\n");
         return EXIT_FAILURE;
     }
     
-    conf_fd = fopen(argv[1], "r");
+    if(0 == strcmp("-", argv[1]))
+    {
+        conf_fd = stdin;
+    }
+    else
+    {
+        conf_fd = fopen(argv[1], "r");
+    }
     
     if(NULL != conf_fd)
     {
Add option to read from stdin
