summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorlouie <lshprung@yahoo.com>2020-07-08 16:11:59 -0700
committerlouie <lshprung@yahoo.com>2020-07-08 16:11:59 -0700
commite95d1c2aa7447cd99700120716820f89ec88dbe4 (patch)
tree4e016a401f3d3707ed3c5712958d3596e16d64bc /draw.c
parent697ba798ab9ac09ba84dbf2285bcb0fb44ea0b36 (diff)
Added ability to specify config location; polished read_cfg error output
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/draw.c b/draw.c
index f059c05..92d5bb4 100644
--- a/draw.c
+++ b/draw.c
@@ -36,13 +36,17 @@ int e_offset = 0;
//TODO consider figuring out where some refreshes are unecessary
-int main(){
+int main(int argc, char **argv){
+ char *cfg_path = "config";
bool tall = true; //is the window a certain height (tbd what the threshold should be TODO)
bool wide = true; //is the window a certain width (tbd what the threshold should be TODO)
int input;
+ //if a config path was given as an argument, set it accordingly
+ if(argc > 2 && (!strcmp(argv[1], "-c") || !strcmp(argv[1], "--cfg_path"))) cfg_path = argv[2];
+
//Fill Groups
- cfg_interp(); //read the contents of the cfg file
+ cfg_interp(cfg_path); //read the contents of the cfg file
g = get_groups(); //retrieve results of previous function
g_count = get_gcount(g); //retrieve number of groups in g