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
132
133
134
// Copyright (c) 2017 cargo-cli developers
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
//! Create a command line interface binary with some common dependencies (([`clap`][clap] ||
//! [`docopt`][docopt]) and [`error_chain`][error_chain])
//!
//! # Installation
//! `cargo install cargo-cli`
//!
//! # Usage
//! In general, this is extension is used in the same manner as you would use `cargo new --bin`.
//! Most of the command line arguments supported by `cargo new` are supported by `cargo cli` and are
//! actually passed through to `cargo new`.
//!
//! In addition, `cargo cli` supports the following options:
//!
//! * `arg_parser`: Specify the argument parser to use in the generated output. [default: clap]
//! [values: clap, docopt]
//! * `license`: Specify licensing to include in the generated output. [default: both]
//! [values: both, mit, apache, none]
//! * `no-readme`: Turn off README.md generation.
//! * `no-latest`: Turn off the crates.io query for the latest version (use defaults).
//!
//! ```text
//! cargo-cli 0.1.0
//!
//! USAGE:
//! cargo-cli cli [FLAGS] [OPTIONS] <path>
//!
//! FLAGS:
//! --frozen Require Cargo.lock and cache are up to date
//! -h, --help Prints help information
//! --locked Require Cargo.lock is up to date
//! --no-latest Turn off the crates.io query for the latest version (use defaults).
//! --no-readme Turn off README.md generation.
//! -q, --quiet No output printed to stdout
//! -v Use verbose output (-vv very verbose/build.rs output)
//!
//! OPTIONS:
//! -a, --arg_parser <PARSER> Specify the argument parser to use in the generated output.
//! [default: clap] [values: clap, docopt]
//! --color <WHEN> Coloring [default: auto] [values: auto, always, never]
//! --license <TYPE> Specify licensing to include in the generated output.
//! [default: both] [values: both, mit, apache, none]
//! --name <NAME> Set the resulting package name, defaults to the value of
//! <path>.
//! --vcs <VCS> Initialize a new repository for the given version control
//! system or do not initialize any version control at all,
//! overriding a global configuration. [default: git]
//! [values: git, hg, pijul, fossil, none]
//!
//! ARGS:
//! <path>
//! ```
//!
//! # Examples
//! ### With clap
//! `cargo cli <path>`
//!
//! ### With docopt
//! `cargo cli -a docopt <path>`
//!
//! ### No licenses or README.md
//! `cargo cli --license none --no-readme <path>`
//!
//! ### With some `cargo new` arguments
//! `cargo cli --vcs pijul -vv -a docopt --name flambe <path>`
//!
//! # CLI Layout
//!
//! ### Default
//! ```text
//! .
//! ├── Cargo.toml
//! ├── LICENSE-APACHE
//! ├── LICENSE-MIT
//! ├── README.md
//! └── src
//! ├── error.rs
//! ├── main.rs
//! └── run.rs
//! ```
//!
//! ### No Licenses or README.md
//! ```text
//! .
//! ├── Cargo.toml
//! └── src
//! ├── error.rs
//! ├── main.rs
//! └── run.rs
//! ```
//!
//! [clap]: https://clap.rs/
//! [docopt]: https://github.com/docopt/docopt.rs
//! [error_chain]: https://github.com/brson/error-chain
//!
extern crate error_chain;
extern crate serde_derive;
extern crate clap;
extern crate curl;
extern crate mustache;
extern crate serde_json;
extern crate term;
extern crate toml;
use ;
use process;
/// Userload Entry Point