[CLI] a warm welcome message included :) (#1417)
* [CLI] a warm welcome message included :) * Update layout * update layout
This commit is contained in:
parent
27e2b5c5da
commit
9fbfd06663
@ -4,7 +4,10 @@
|
||||
[package]
|
||||
name = "sea-orm-cli"
|
||||
version = "0.10.3"
|
||||
authors = ["Billy Chan <ccw.billy.123@gmail.com>"]
|
||||
authors = [
|
||||
"Chris Tsang <chris.2y3@outlook.com>",
|
||||
"Billy Chan <ccw.billy.123@gmail.com>",
|
||||
]
|
||||
edition = "2021"
|
||||
description = "Command line utility for SeaORM"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
@ -1,7 +1,41 @@
|
||||
use clap::{ArgEnum, ArgGroup, Parser, Subcommand};
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(version)]
|
||||
#[clap(
|
||||
version,
|
||||
author,
|
||||
help_template = r#"{before-help}{name} {version}
|
||||
{about-with-newline}
|
||||
|
||||
{usage-heading} {usage}
|
||||
|
||||
{all-args}{after-help}
|
||||
|
||||
AUTHORS:
|
||||
{author}
|
||||
"#,
|
||||
about = r#"
|
||||
____ ___ ____ __ __ /\
|
||||
/ ___| ___ __ _ / _ \ | _ \ | \/ | {.-}
|
||||
\___ \ / _ \ / _` || | | || |_) || |\/| | ;_.-'\
|
||||
___) || __/| (_| || |_| || _ < | | | | { _.}_
|
||||
|____/ \___| \__,_| \___/ |_| \_\|_| |_| \.-' / `,
|
||||
\ | /
|
||||
An async & dynamic ORM for Rust \ | ,/
|
||||
=============================== \|_/
|
||||
|
||||
Getting Started!
|
||||
- documentation: https://www.sea-ql.org/SeaORM
|
||||
- step-by-step tutorials: https://www.sea-ql.org/sea-orm-tutorial
|
||||
- integration examples: https://github.com/SeaQL/sea-orm/tree/master/examples
|
||||
- cookbook: https://www.sea-ql.org/sea-orm-cookbook
|
||||
|
||||
Join our Discord server to chat with others in the SeaQL community!
|
||||
- invitation link: https://discord.com/invite/uCPdDXzbdv
|
||||
|
||||
If you like what we do, consider starring, commenting, sharing and contributing!
|
||||
"#
|
||||
)]
|
||||
pub struct Cli {
|
||||
#[clap(action, global = true, short, long, help = "Show debug messages")]
|
||||
pub verbose: bool,
|
||||
@ -12,13 +46,16 @@ pub struct Cli {
|
||||
|
||||
#[derive(Subcommand, PartialEq, Eq, Debug)]
|
||||
pub enum Commands {
|
||||
#[clap(about = "Codegen related commands")]
|
||||
#[clap(arg_required_else_help = true)]
|
||||
#[clap(
|
||||
about = "Codegen related commands",
|
||||
arg_required_else_help = true,
|
||||
display_order = 10
|
||||
)]
|
||||
Generate {
|
||||
#[clap(subcommand)]
|
||||
command: GenerateSubcommands,
|
||||
},
|
||||
#[clap(about = "Migration related commands")]
|
||||
#[clap(about = "Migration related commands", display_order = 20)]
|
||||
Migrate {
|
||||
#[clap(
|
||||
value_parser,
|
||||
@ -63,9 +100,9 @@ you should provide the directory of that submodule.",
|
||||
|
||||
#[derive(Subcommand, PartialEq, Eq, Debug)]
|
||||
pub enum MigrateSubcommands {
|
||||
#[clap(about = "Initialize migration directory")]
|
||||
#[clap(about = "Initialize migration directory", display_order = 10)]
|
||||
Init,
|
||||
#[clap(about = "Generate a new, empty migration")]
|
||||
#[clap(about = "Generate a new, empty migration", display_order = 20)]
|
||||
Generate {
|
||||
#[clap(
|
||||
value_parser,
|
||||
@ -82,15 +119,21 @@ pub enum MigrateSubcommands {
|
||||
)]
|
||||
universal_time: bool,
|
||||
},
|
||||
#[clap(about = "Drop all tables from the database, then reapply all migrations")]
|
||||
#[clap(
|
||||
about = "Drop all tables from the database, then reapply all migrations",
|
||||
display_order = 30
|
||||
)]
|
||||
Fresh,
|
||||
#[clap(about = "Rollback all applied migrations, then reapply all migrations")]
|
||||
#[clap(
|
||||
about = "Rollback all applied migrations, then reapply all migrations",
|
||||
display_order = 40
|
||||
)]
|
||||
Refresh,
|
||||
#[clap(about = "Rollback all applied migrations")]
|
||||
#[clap(about = "Rollback all applied migrations", display_order = 50)]
|
||||
Reset,
|
||||
#[clap(about = "Check the status of all migrations")]
|
||||
#[clap(about = "Check the status of all migrations", display_order = 60)]
|
||||
Status,
|
||||
#[clap(about = "Apply pending migrations")]
|
||||
#[clap(about = "Apply pending migrations", display_order = 70)]
|
||||
Up {
|
||||
#[clap(
|
||||
value_parser,
|
||||
@ -100,14 +143,19 @@ pub enum MigrateSubcommands {
|
||||
)]
|
||||
num: Option<u32>,
|
||||
},
|
||||
#[clap(value_parser, about = "Rollback applied migrations")]
|
||||
#[clap(
|
||||
value_parser,
|
||||
about = "Rollback applied migrations",
|
||||
display_order = 80
|
||||
)]
|
||||
Down {
|
||||
#[clap(
|
||||
value_parser,
|
||||
short,
|
||||
long,
|
||||
default_value = "1",
|
||||
help = "Number of applied migrations to be rolled back"
|
||||
help = "Number of applied migrations to be rolled back",
|
||||
display_order = 90
|
||||
)]
|
||||
num: u32,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user