1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
//! Issue/PR exporter for GitHub. //! //! # dumplingh as а library //! //! ## Data flow //! //! ```plaintext //! Options::parse() //! |> list_{pull_requests,issues}() //! |> save_{to_file,data}() //! ``` //! //! ## Example //! //! ``` //! # use dumplingh::ops::{save_to_file, list_pull_requests}; //! # use std::env::temp_dir; //! # use std::fs; //! # /* //! let out_path = "pulls.json"; //! # */ //! # let mut out_path = temp_dir().join("dumplingh-doctest"); //! # fs::create_dir_all(&out_path).unwrap(); //! # out_path.push("pulls.json"); //! let repo = "nabijaczleweli/cargo-update".parse().unwrap(); //! let pulls = list_pull_requests(&repo, None).unwrap(); //! save_to_file(out_path, &pulls, false, "pull requests").unwrap(); //! ``` //! //! # dumplingh as аn executable //! //! This is just a very short synopsis of //! [the manpage](https://rawcdn.githack.com/nabijaczleweli/dumplingh/man/dumplingh.1.html), //! so consult that for more data. //! //! ## OPTIONS //! //! | Option | Description | //! |--------------------------------------|--------------------------------------------------------------------------| //! | <REPO_SLUG> | Repository to export issues and PRs for in the form `<username>/<repo>`. | //! | --issues <ISSUES_FILE> | File to export issues to, or `./<slug>-issues.json` by default. | //! | --pulls <PULLS_FILE> | File to export pull requests to, or `./<slug>-pulls.json` by default. | //! | --labels <LABELS_FILE> | File to export labels to, or `./<slug>-labels.json` by default. | //! | --milestones <MILESTONES_FILE> | File to export milestones to, or `./<slug>-milestones.json` by default. | //! | --projects <PROJECTS_FILE> | File to export projects to, or `./<slug>-projects.json` by default. | //! | --comments <COMMENTS_DIR> | Directory to export comments to, or `./<slug>-comments` by default. | //! | --auth [AUTH_TOKEN] | GitHub OAuth2 token, required for projects. | //! | --no-issues | Don't export issues. | //! | --no-pulls | Don't export pull requests. | //! | --no-labels | Don't export labels. | //! | --no-milestones | Don't export milestones. | //! | --no-projects | Don't export projects. | //! | --no-comments | Don't export comments. | //! | --force | Override existing files. | //! | --compact | Don't pretty-print exported JSON. | #[macro_use] extern crate lazy_static; extern crate serde_json; extern crate reqwest; extern crate serde; #[macro_use] extern crate clap; mod error; mod options; pub mod ops; pub mod util; pub use self::error::Error; pub use self::options::Options;