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
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! # leetcode-cli
//! [![doc](https://img.shields.io/badge/0.1.7-docs-green.svg)](https://docs.rs/leetcode-cli/)
//! [![Crates.io](https://img.shields.io/crates/v/leetcode-cli.svg)](https://crates.io/crates/leetcode-cli)
//! [![Crates.io](https://img.shields.io/crates/d/leetcode-cli.svg)](https://crates.io/crates/leetcode-cli)
//! [![LICENSE](https://img.shields.io/crates/l/leetcode-cli.svg)](https://choosealicense.com/licenses/mit/)
//! 
//! ## Not Available for Now
//! 
//! If you need to, keep time on me...expect to launch at v0.3.0.
//! 
//! and,
//! 
//! the DEADLINE is `Sub Jan 5 23:59:59 CST 2020`.
//! 
//! 
//! ## Note
//! > (only support OSX temporarily)
//! 
//! Please make sure you have logined in `leetcode.com` with `chrome`.
//! 
//! 
//! ## Features
//! 
//! 1. the edit flow —— solution files will generate automatically!
//! 2. doc support, `lc-rs` can compile the annotation of your solutions to markdown!
//!    1. btw, generate a site is easy for `lc-rs`!
//! 3. support local signal to keep coding as longer as you want.
//! 
//! 
//! ## Building
//! 
//! ```
//! cargo install leetcode-cli
//! ```
//! 
//! 
//! ## Usage
//! ```sh
//! leetcode 0.1.7
//! clearloop <udtrokia@163.com>
//! Leet your code in command-line.
//! 
//! USAGE:
//!     leetcode [FLAGS] [SUBCOMMAND]
//! 
//! FLAGS:
//!     -d, --debug      debug mode
//!     -h, --help       Prints help information
//!     -V, --version    Prints version information
//! 
//! SUBCOMMANDS:
//!     cache    Manage Cache [aliases: c]
//!     list     List problems [aliases: l]
//!     pick     Pick a problem [aliases: p]
//!     stat     Show simple chart about submissions [aliases: s]
//!     help     Prints this message or the help of the given subcommand(s)
//! ```
//! 
//! ## Example
//! 
//! For example, if your config is:
//! 
//! ```toml
//! [storage]
//! code = "code"
//! 
//! [code]
//! lang = "rust"
//! editor = "emacs"
//! ```
//! 
//! #### 1. <kbd>pick</kbd> a question:
//! 
//! ```
//! leetcode pick 1
//! ```
//! 
//! `lc-rs` will generate `1.two-sum.alogrithms` at `~/.leetcode/code/1.two-sum.algorithms.rs`
//! 
//! #### 2. <kbd>edit</kbd> it
//! 
//! ```
//! leetcode edit 1
//! ```
//! 
//! #### 3. The `emacs` will be with you
//! 
//! ```
//! coding...
//! ```
//! 
//! #### 4. <kbd>test</kbd> it.
//! 
//! ```
//! leetcode test 1
//! ```
//! 
//! #### 5. <kbd>submit</kbd> it
//! 
//! ```
//! leetcode submit 1
//! ```
//! 
//! 
//! ## PR
//! 
//! PR is welcome, [here][pr] it is.
//! 
//! ## LICENSE
//! MIT
//! 
//! 
//! [pr]: https://github.com/clearloop/leetcode-cli/pulls
//! [sky]: https://github.com/skygragon/leetcode-cli
#![feature(try_trait)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate diesel;

mod err;
pub mod cache;
pub mod cfg;
pub mod cli;
pub mod cmds;
pub mod flag;
pub mod helper;
pub mod plugins;

/// re-exports
pub use err::Error;