on main help sign in
Add version and description to CLI
033ac5bfabianlindfors
Cargo.toml+1−1
@@ -17,7 +17,7 @@ serde = { version = "1.0", features = ["derive"] }
17serde_json = "1.0"
17serde_json = "1.0"
18typetag = "0.1.7"
18typetag = "0.1.7"
19anyhow = { version = "1.0.44", features = ["backtrace"] }
19anyhow = { version = "1.0.44", features = ["backtrace"] }
20−clap = { version = "3.0.0", features = ["derive"] }
20+clap = { version = "3.0.14", features = ["derive"] }
21toml = "0.5"
21toml = "0.5"
22version = "3.0.0"
22version = "3.0.0"
23colored = "2"
23colored = "2"
src/lib.rs+2−2
@@ -174,8 +174,8 @@ fn migrate(
174 {
174 {
175 if existing_migrations != &remaining_migrations {
175 if existing_migrations != &remaining_migrations {
176 return Err(anyhow!(
176 return Err(anyhow!(
177− "a previous migration seems to have failed without cleaning up. Please run `reshape abort` and then run migrate again."
177+ "a previous migration seems to have failed without cleaning up. Please run `reshape abort` and then run migrate again."
178− ));
178+ ));
179 }
179 }
180 }
180 }
181
181
src/main.rs+3
@@ -12,12 +12,14 @@ use reshape::{
12use serde::{Deserialize, Serialize};
12use serde::{Deserialize, Serialize};
13
13
14#[derive(Parser)]
14#[derive(Parser)]
15+#[clap(name = "Reshape", version, about)]
15struct Opts {
16struct Opts {
16 #[clap(subcommand)]
17 #[clap(subcommand)]
17 cmd: Command,
18 cmd: Command,
18}
19}
19
20
20#[derive(Parser)]
21#[derive(Parser)]
22+#[clap(about)]
21enum Command {
23enum Command {
22 Migrate(MigrateOptions),
24 Migrate(MigrateOptions),
23 Complete(ConnectionOptions),
25 Complete(ConnectionOptions),
@@ -28,6 +30,7 @@ enum Command {
28
30
29#[derive(Args)]
31#[derive(Args)]
30struct MigrateOptions {
32struct MigrateOptions {
33+ // Some comment
31 #[clap(long, short)]
34 #[clap(long, short)]
32 complete: bool,
35 complete: bool,
33 #[clap(flatten)]
36 #[clap(flatten)]