Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor clap_generate #1678

Merged
merged 3 commits into from
Feb 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ features = ["doc"]
[workspace]
members = [
"clap_derive",
"clap_generate",
]
default-members = [
".", "clap_derive",
".",
"clap_derive",
"clap_generate",
]
1 change: 1 addition & 0 deletions clap_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ proc-macro-error = "0.4.3"
clap = { path = "../", version = "3.0.0-beta.1" }
trybuild = "1.0.5"
rustversion = "1"
version-sync = "0.8"

[features]
default = []
Expand Down
7 changes: 1 addition & 6 deletions clap_derive/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Work in Progress

This crate is currently a work in progress and not meant to be used. Please use [`structopt`](https://github.com/TeXitoi/structopt)
while this crate is being built.

# clap_derive[![Build status](https://travis-ci.org/clap-rs/clap_derive.svg?branch=master)](https://travis-ci.org/clap-rs/clap_derive) [![](https://img.shields.io/crates/v/clap_derive.svg)](https://crates.io/crates/clap_derive) [![](https://docs.rs/clap_derive/badge.svg)](https://docs.rs/clap_derive)
# clap_derive

Parse command line argument by defining a struct. It combines [structopt](https://github.com/TeXitoi/structopt) and [clap](https://crates.io/crates/clap) into a single experience. This crate is used by clap, and not meant to be used directly by
consumers.
Expand Down
50 changes: 50 additions & 0 deletions clap_generate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "clap_generate"
version = "3.0.0-beta.1"
edition = "2018"
authors = [
"Kevin K. <[email protected]>",
"Pavan Kumar Sunkara <[email protected]>",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We exist as well :p

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been meaning to just remove all the names and put "Clap Contributors". What do you think?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was going to be my next suggestion. The Clap Team or Clap Maintainers

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to propose leave @kbknapp - as original author of these crates - and @TeXitoi (in clap_derive/Cargo.toml) - as original author of the derive; and then put "Clap Contributors". I want to highlight them because they have (or had) been putting admirable amount of efforts into these crates from the very beginning, even thought the crates weren't so hypy and popular back then.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fine to me as well. I'd rather go with Maintainers though than contributors. There's a subtle difference

]
include = [
"src/**/*",
"Cargo.toml",
"README.md"
]
description = "A generator library used with clap for shell completion scripts, manpage, etc."
repository = "https://github.com/clap-rs/clap/tree/master/clap_generate"
documentation = "https://docs.rs/clap_generate"
homepage = "https://clap.rs/"
keywords = [
"clap",
"cli",
"generate",
"completion",
"manpage",
"parse"
]
categories = ["command-line-interface"]
license = "MIT OR Apache-2.0"
readme = "README.md"

[badges]
is-it-maintained-issue-resolution = { repository = "clap-rs/clap" }
is-it-maintained-open-issues = { repository = "clap-rs/clap" }
maintenance = {status = "actively-developed"}

[dependencies]
clap = { path = "../", version = "3.0.0-beta.1" }

[dev-dependencies]
pretty_assertions = "0.6"
version-sync = "0.8"

[features]
default = []
unstable = ["clap/unstable"]
nightly = ["clap/nightly"]
debug = ["clap/debug"]
doc = []

[package.metadata.docs.rs]
features = ["doc"]
1 change: 1 addition & 0 deletions clap_generate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# clap_generate
11 changes: 11 additions & 0 deletions clap_generate/examples/bash_completion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use clap::App;
use clap_generate::{generate, generators::Bash};
use std::io;

fn main() {
let mut app = App::new("myapp")
.subcommand(App::new("test").subcommand(App::new("config")))
.subcommand(App::new("hello"));

generate::<Bash, _>(&mut app, "myapp", &mut io::stdout());
CreepySkeleton marked this conversation as resolved.
Show resolved Hide resolved
}
Loading