Skip to content

Commit

Permalink
clap can now generate completions to a string; no need for codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
davidszotten committed Aug 2, 2016
1 parent 16cf8cd commit cccbd91
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
6 changes: 1 addition & 5 deletions diesel_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ documentation = "http://diesel.rs/guides/getting-started"
homepage = "http://diesel.rs"
repository = "https://github.com/diesel-rs/diesel"
keywords = ["orm", "database", "postgres", "postgresql", "sql"]
build = "build.rs"

[[bin]]
name = "diesel"

[dependencies]
chrono = "0.2.17"
clap = "2.9"
clap = "2.10"
diesel = { version = "0.7.0", default-features = false }
dotenv = "0.8.0"

[dev-dependencies]
tempdir = "0.3.4"
regex = "0.1.48"

[build-dependencies]
clap = "2.9"

[features]
default = ["postgres", "sqlite"]
postgres = ["diesel/postgres"]
Expand Down
10 changes: 0 additions & 10 deletions diesel_cli/build.rs

This file was deleted.

5 changes: 0 additions & 5 deletions diesel_cli/src/completion_script.rs

This file was deleted.

5 changes: 2 additions & 3 deletions diesel_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ mod database_error;
#[macro_use]
mod database;
mod cli;
mod completion_script;

use chrono::*;
use clap::ArgMatches;
use clap::{ArgMatches,Shell};
#[cfg(feature = "postgres")]
use diesel::pg::PgConnection;
#[cfg(feature = "sqlite")]
Expand Down Expand Up @@ -116,7 +115,7 @@ fn run_database_command(matches: &ArgMatches) {
}

fn generate_bash_completion_command(_: &ArgMatches) {
print!("{}", completion_script::BASH_COMPLETION_SCRIPT);
cli::build_cli().gen_completions_to("diesel", Shell::Bash, &mut stdout());
}

/// Looks for a migrations directory in the current path and all parent paths,
Expand Down

0 comments on commit cccbd91

Please sign in to comment.