{"action":"created","comment":{"url":"https://api.github.com/repos/gkoz/gir/pulls/comments/32969531","id":32969531,"diff_hunk":"@@ -1,21 +1,54 @@\n extern crate docopt;\n extern crate xml;\n+extern crate toml;\n \n-mod library;\n-mod parser;\n-\n+use std::fs::File;\n+use std::io::prelude::*;\n use docopt::Docopt;\n use library::*;\n \n+mod gobjects;\n+mod library;\n+mod parser;\n+\n static USAGE: &'static str = \"\n-Usage: spore -d <dir> <lib>\n+Usage: gir [-d <girs_dir>] [<gir>]\n+\n+Options:\n+    -d PATH            Directory for girs\n \";\n \n fn main() {\n     let args = Docopt::new(USAGE).unwrap()\n         .parse().unwrap_or_else(|e| e.exit());\n+    //println!(\"{:?}\", args);\n+    //println!(\"Dir: {}\", args.get_str(\"-d\"));\n+    //println!(\"File: {}\", args.get_str(\"<gir>\"));\n+    \n+    let toml = read_toml(\"Gir.toml\");\n+    // println!(\"Toml: {:?}\", toml);\n+    \n+    let girs_dir = match args.get_str(\"-d\") {\n+        \"\" => toml.lookup(\"options.girs_dir\")\n+                  .unwrap_or_else(|| panic!(\"No options.girs_dir in config\"))\n+                  .as_str().unwrap(),\n+        a => a\n+    };\n+    //println!(\"Dir: {:?}\", girs_dir);\n+\n+    let gir = match args.get_str(\"<gir>\") {\n+        \"\" => toml.lookup(\"options.gir\")","path":"src/main.rs","position":44,"original_position":44,"commit_id":"74202e6843edfe082db5cd94164362e51bf0bad2","original_commit_id":"74202e6843edfe082db5cd94164362e51bf0bad2","user":{"login":"EPashkin","id":584258,"avatar_url":"https://avatars.githubusercontent.com/u/584258?v=3","gravatar_id":"","url":"https://api.github.com/users/EPashkin","html_url":"https://github.com/EPashkin","followers_url":"https://api.github.com/users/EPashkin/followers","following_url":"https://api.github.com/users/EPashkin/following{/other_user}","gists_url":"https://api.github.com/users/EPashkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPashkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPashkin/subscriptions","organizations_url":"https://api.github.com/users/EPashkin/orgs","repos_url":"https://api.github.com/users/EPashkin/repos","events_url":"https://api.github.com/users/EPashkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPashkin/received_events","type":"User","site_admin":false},"body":"Parameter `<library>` with `let library_name = match ...` ?","created_at":"2015-06-22T18:51:28Z","updated_at":"2015-06-22T18:51:28Z","html_url":"https://github.com/gkoz/gir/pull/2#discussion_r32969531","pull_request_url":"https://api.github.com/repos/gkoz/gir/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/gkoz/gir/pulls/comments/32969531"},"html":{"href":"https://github.com/gkoz/gir/pull/2#discussion_r32969531"},"pull_request":{"href":"https://api.github.com/repos/gkoz/gir/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/gkoz/gir/pulls/2","id":38251932,"html_url":"https://github.com/gkoz/gir/pull/2","diff_url":"https://github.com/gkoz/gir/pull/2.diff","patch_url":"https://github.com/gkoz/gir/pull/2.patch","issue_url":"https://api.github.com/repos/gkoz/gir/issues/2","number":2,"state":"open","locked":false,"title":"Add object list in config","user":{"login":"EPashkin","id":584258,"avatar_url":"https://avatars.githubusercontent.com/u/584258?v=3","gravatar_id":"","url":"https://api.github.com/users/EPashkin","html_url":"https://github.com/EPashkin","followers_url":"https://api.github.com/users/EPashkin/followers","following_url":"https://api.github.com/users/EPashkin/following{/other_user}","gists_url":"https://api.github.com/users/EPashkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPashkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPashkin/subscriptions","organizations_url":"https://api.github.com/users/EPashkin/orgs","repos_url":"https://api.github.com/users/EPashkin/repos","events_url":"https://api.github.com/users/EPashkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPashkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-22T16:47:42Z","updated_at":"2015-06-22T18:51:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"224e29f978637272cb941e8509beecedb1ae6f1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gkoz/gir/pulls/2/commits","review_comments_url":"https://api.github.com/repos/gkoz/gir/pulls/2/comments","review_comment_url":"https://api.github.com/repos/gkoz/gir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gkoz/gir/issues/2/comments","statuses_url":"https://api.github.com/repos/gkoz/gir/statuses/74202e6843edfe082db5cd94164362e51bf0bad2","head":{"label":"EPashkin:gobject","ref":"gobject","sha":"74202e6843edfe082db5cd94164362e51bf0bad2","user":{"login":"EPashkin","id":584258,"avatar_url":"https://avatars.githubusercontent.com/u/584258?v=3","gravatar_id":"","url":"https://api.github.com/users/EPashkin","html_url":"https://github.com/EPashkin","followers_url":"https://api.github.com/users/EPashkin/followers","following_url":"https://api.github.com/users/EPashkin/following{/other_user}","gists_url":"https://api.github.com/users/EPashkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPashkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPashkin/subscriptions","organizations_url":"https://api.github.com/users/EPashkin/orgs","repos_url":"https://api.github.com/users/EPashkin/repos","events_url":"https://api.github.com/users/EPashkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPashkin/received_events","type":"User","site_admin":false},"repo":{"id":37834474,"name":"gir","full_name":"EPashkin/gir","owner":{"login":"EPashkin","id":584258,"avatar_url":"https://avatars.githubusercontent.com/u/584258?v=3","gravatar_id":"","url":"https://api.github.com/users/EPashkin","html_url":"https://github.com/EPashkin","followers_url":"https://api.github.com/users/EPashkin/followers","following_url":"https://api.github.com/users/EPashkin/following{/other_user}","gists_url":"https://api.github.com/users/EPashkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPashkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPashkin/subscriptions","organizations_url":"https://api.github.com/users/EPashkin/orgs","repos_url":"https://api.github.com/users/EPashkin/repos","events_url":"https://api.github.com/users/EPashkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPashkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EPashkin/gir","description":"","fork":true,"url":"https://api.github.com/repos/EPashkin/gir","forks_url":"https://api.github.com/repos/EPashkin/gir/forks","keys_url":"https://api.github.com/repos/EPashkin/gir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EPashkin/gir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EPashkin/gir/teams","hooks_url":"https://api.github.com/repos/EPashkin/gir/hooks","issue_events_url":"https://api.github.com/repos/EPashkin/gir/issues/events{/number}","events_url":"https://api.github.com/repos/EPashkin/gir/events","assignees_url":"https://api.github.com/repos/EPashkin/gir/assignees{/user}","branches_url":"https://api.github.com/repos/EPashkin/gir/branches{/branch}","tags_url":"https://api.github.com/repos/EPashkin/gir/tags","blobs_url":"https://api.github.com/repos/EPashkin/gir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EPashkin/gir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EPashkin/gir/git/refs{/sha}","trees_url":"https://api.github.com/repos/EPashkin/gir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EPashkin/gir/statuses/{sha}","languages_url":"https://api.github.com/repos/EPashkin/gir/languages","stargazers_url":"https://api.github.com/repos/EPashkin/gir/stargazers","contributors_url":"https://api.github.com/repos/EPashkin/gir/contributors","subscribers_url":"https://api.github.com/repos/EPashkin/gir/subscribers","subscription_url":"https://api.github.com/repos/EPashkin/gir/subscription","commits_url":"https://api.github.com/repos/EPashkin/gir/commits{/sha}","git_commits_url":"https://api.github.com/repos/EPashkin/gir/git/commits{/sha}","comments_url":"https://api.github.com/repos/EPashkin/gir/comments{/number}","issue_comment_url":"https://api.github.com/repos/EPashkin/gir/issues/comments{/number}","contents_url":"https://api.github.com/repos/EPashkin/gir/contents/{+path}","compare_url":"https://api.github.com/repos/EPashkin/gir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EPashkin/gir/merges","archive_url":"https://api.github.com/repos/EPashkin/gir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EPashkin/gir/downloads","issues_url":"https://api.github.com/repos/EPashkin/gir/issues{/number}","pulls_url":"https://api.github.com/repos/EPashkin/gir/pulls{/number}","milestones_url":"https://api.github.com/repos/EPashkin/gir/milestones{/number}","notifications_url":"https://api.github.com/repos/EPashkin/gir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EPashkin/gir/labels{/name}","releases_url":"https://api.github.com/repos/EPashkin/gir/releases{/id}","created_at":"2015-06-22T02:31:02Z","updated_at":"2015-06-22T02:32:00Z","pushed_at":"2015-06-22T18:38:36Z","git_url":"git://github.com/EPashkin/gir.git","ssh_url":"git@github.com:EPashkin/gir.git","clone_url":"https://github.com/EPashkin/gir.git","svn_url":"https://github.com/EPashkin/gir","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gkoz:master","ref":"master","sha":"b970fb5175fc5919b4334a0cf8711e5d64e8be13","user":{"login":"gkoz","id":4260361,"avatar_url":"https://avatars.githubusercontent.com/u/4260361?v=3","gravatar_id":"","url":"https://api.github.com/users/gkoz","html_url":"https://github.com/gkoz","followers_url":"https://api.github.com/users/gkoz/followers","following_url":"https://api.github.com/users/gkoz/following{/other_user}","gists_url":"https://api.github.com/users/gkoz/gists{/gist_id}","starred_url":"https://api.github.com/users/gkoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkoz/subscriptions","organizations_url":"https://api.github.com/users/gkoz/orgs","repos_url":"https://api.github.com/users/gkoz/repos","events_url":"https://api.github.com/users/gkoz/events{/privacy}","received_events_url":"https://api.github.com/users/gkoz/received_events","type":"User","site_admin":false},"repo":{"id":37824715,"name":"gir","full_name":"gkoz/gir","owner":{"login":"gkoz","id":4260361,"avatar_url":"https://avatars.githubusercontent.com/u/4260361?v=3","gravatar_id":"","url":"https://api.github.com/users/gkoz","html_url":"https://github.com/gkoz","followers_url":"https://api.github.com/users/gkoz/followers","following_url":"https://api.github.com/users/gkoz/following{/other_user}","gists_url":"https://api.github.com/users/gkoz/gists{/gist_id}","starred_url":"https://api.github.com/users/gkoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkoz/subscriptions","organizations_url":"https://api.github.com/users/gkoz/orgs","repos_url":"https://api.github.com/users/gkoz/repos","events_url":"https://api.github.com/users/gkoz/events{/privacy}","received_events_url":"https://api.github.com/users/gkoz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gkoz/gir","description":"","fork":false,"url":"https://api.github.com/repos/gkoz/gir","forks_url":"https://api.github.com/repos/gkoz/gir/forks","keys_url":"https://api.github.com/repos/gkoz/gir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gkoz/gir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gkoz/gir/teams","hooks_url":"https://api.github.com/repos/gkoz/gir/hooks","issue_events_url":"https://api.github.com/repos/gkoz/gir/issues/events{/number}","events_url":"https://api.github.com/repos/gkoz/gir/events","assignees_url":"https://api.github.com/repos/gkoz/gir/assignees{/user}","branches_url":"https://api.github.com/repos/gkoz/gir/branches{/branch}","tags_url":"https://api.github.com/repos/gkoz/gir/tags","blobs_url":"https://api.github.com/repos/gkoz/gir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gkoz/gir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gkoz/gir/git/refs{/sha}","trees_url":"https://api.github.com/repos/gkoz/gir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gkoz/gir/statuses/{sha}","languages_url":"https://api.github.com/repos/gkoz/gir/languages","stargazers_url":"https://api.github.com/repos/gkoz/gir/stargazers","contributors_url":"https://api.github.com/repos/gkoz/gir/contributors","subscribers_url":"https://api.github.com/repos/gkoz/gir/subscribers","subscription_url":"https://api.github.com/repos/gkoz/gir/subscription","commits_url":"https://api.github.com/repos/gkoz/gir/commits{/sha}","git_commits_url":"https://api.github.com/repos/gkoz/gir/git/commits{/sha}","comments_url":"https://api.github.com/repos/gkoz/gir/comments{/number}","issue_comment_url":"https://api.github.com/repos/gkoz/gir/issues/comments{/number}","contents_url":"https://api.github.com/repos/gkoz/gir/contents/{+path}","compare_url":"https://api.github.com/repos/gkoz/gir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gkoz/gir/merges","archive_url":"https://api.github.com/repos/gkoz/gir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gkoz/gir/downloads","issues_url":"https://api.github.com/repos/gkoz/gir/issues{/number}","pulls_url":"https://api.github.com/repos/gkoz/gir/pulls{/number}","milestones_url":"https://api.github.com/repos/gkoz/gir/milestones{/number}","notifications_url":"https://api.github.com/repos/gkoz/gir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gkoz/gir/labels{/name}","releases_url":"https://api.github.com/repos/gkoz/gir/releases{/id}","created_at":"2015-06-21T20:29:55Z","updated_at":"2015-06-21T20:33:13Z","pushed_at":"2015-06-22T18:44:18Z","git_url":"git://github.com/gkoz/gir.git","ssh_url":"git@github.com:gkoz/gir.git","clone_url":"https://github.com/gkoz/gir.git","svn_url":"https://github.com/gkoz/gir","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gkoz/gir/pulls/2"},"html":{"href":"https://github.com/gkoz/gir/pull/2"},"issue":{"href":"https://api.github.com/repos/gkoz/gir/issues/2"},"comments":{"href":"https://api.github.com/repos/gkoz/gir/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/gkoz/gir/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/gkoz/gir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gkoz/gir/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/gkoz/gir/statuses/74202e6843edfe082db5cd94164362e51bf0bad2"}}}}