Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
migra/migra-cli/src/opts.rs
2021-02-03 01:07:26 +03:00

42 lines
876 B
Rust

use std::path::PathBuf;
pub use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(bin_name = "migra", name = "Migra")]
pub(crate) struct AppOpt {
#[structopt(short, long)]
pub config: Option<PathBuf>,
#[structopt(subcommand)]
pub command: Command,
}
#[derive(Debug, StructOpt)]
pub(crate) enum Command {
Init,
Apply(ApplyCommandOpt),
Make(MakeCommandOpt),
#[structopt(name = "list", visible_alias = "ls")]
List,
#[structopt(name = "upgrade", visible_alias = "up")]
Upgrade,
#[structopt(name = "downgrade", visible_alias = "down")]
Downgrade,
}
#[derive(Debug, StructOpt)]
pub(crate) struct ApplyCommandOpt {
#[structopt(parse(from_str))]
pub file_name: String,
}
#[derive(Debug, StructOpt)]
pub(crate) struct MakeCommandOpt {
#[structopt(parse(from_str))]
pub migration_name: String,
}