Add version and description to CLI

This commit is contained in:
fabianlindfors 2022-02-03 23:26:50 +01:00
parent ef6fe64918
commit 033ac5b2f1
3 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
typetag = "0.1.7" typetag = "0.1.7"
anyhow = { version = "1.0.44", features = ["backtrace"] } anyhow = { version = "1.0.44", features = ["backtrace"] }
clap = { version = "3.0.0", features = ["derive"] } clap = { version = "3.0.14", features = ["derive"] }
toml = "0.5" toml = "0.5"
version = "3.0.0" version = "3.0.0"
colored = "2" colored = "2"

View File

@ -174,8 +174,8 @@ fn migrate(
{ {
if existing_migrations != &remaining_migrations { if existing_migrations != &remaining_migrations {
return Err(anyhow!( return Err(anyhow!(
"a previous migration seems to have failed without cleaning up. Please run `reshape abort` and then run migrate again." "a previous migration seems to have failed without cleaning up. Please run `reshape abort` and then run migrate again."
)); ));
} }
} }

View File

@ -12,12 +12,14 @@ use reshape::{
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Parser)] #[derive(Parser)]
#[clap(name = "Reshape", version, about)]
struct Opts { struct Opts {
#[clap(subcommand)] #[clap(subcommand)]
cmd: Command, cmd: Command,
} }
#[derive(Parser)] #[derive(Parser)]
#[clap(about)]
enum Command { enum Command {
Migrate(MigrateOptions), Migrate(MigrateOptions),
Complete(ConnectionOptions), Complete(ConnectionOptions),
@ -28,6 +30,7 @@ enum Command {
#[derive(Args)] #[derive(Args)]
struct MigrateOptions { struct MigrateOptions {
// Some comment
#[clap(long, short)] #[clap(long, short)]
complete: bool, complete: bool,
#[clap(flatten)] #[clap(flatten)]