git flow was a mistake #11

Merged
cafkafk merged 29 commits from dev into main 2023-08-09 16:27:57 +02:00
2 changed files with 29 additions and 8 deletions
Showing only changes of commit 7c6fa896e7 - Show all commits

View file

@ -85,8 +85,8 @@ pub enum Commands {
/// Do quick pull-commit-push with msg for commit /// Do quick pull-commit-push with msg for commit
#[command(visible_alias = "q")] #[command(visible_alias = "q")]
Quick { Quick {
category: Option<String>,
repo: Option<String>, repo: Option<String>,
name: Option<String>,
msg: Option<String>, msg: Option<String>,
}, },

View file

@ -77,7 +77,26 @@ fn main() {
// NOTE: This implements "sub-subcommand"-like matching on repository, // NOTE: This implements "sub-subcommand"-like matching on repository,
// name, and additional data for a subcommand // name, and additional data for a subcommand
// TODO: generalize for reuse by all commands that operate on repo->name->msg // TODO: generalize for reuse by all commands that operate on repo->name->msg
Some(Commands::Quick { repo, name, msg }) => match (&repo, &name, &msg) { //
// What we want:
// - gg quick
// - gg quick category
// - gg quick category repository
// - gg quick -m "message"
// - gg quick category -m "message"
// - gg quick category repo -m "hi"
//
// What we are implementing:
// - [x] gg quick
// - [ ] gg quick category
// - [ ] gg quick category repository
// - [ ] gg quick category repository "stuff"
Some(Commands::Quick {
category,
repo,
msg,
}) => match (&category, &repo, &msg) {
// - gg quick
(None, None, None) => { (None, None, None) => {
let s = Box::leak( let s = Box::leak(
msg.as_mut() msg.as_mut()
@ -87,19 +106,21 @@ fn main() {
); );
config.quick(s); config.quick(s);
} }
(repo, None, None) => { // - [ ] gg quick category
println!("{}", repo.as_ref().unwrap()); (category, None, None) => {
println!("{}", category.as_ref().unwrap());
todo!(); todo!();
} }
(repo, name, None) => { (category, repo, None) => {
println!("{} {}", repo.as_ref().unwrap(), name.as_ref().unwrap()); println!("{} {}", category.as_ref().unwrap(), repo.as_ref().unwrap());
todo!(); todo!();
} }
(repo, name, msg) => { // - [ ] gg quick category categorysitory "stuff"
(category, repo, msg) => {
println!( println!(
"{} {} {}", "{} {} {}",
category.as_ref().unwrap(),
repo.as_ref().unwrap(), repo.as_ref().unwrap(),
name.as_ref().unwrap(),
msg.as_ref().unwrap(), msg.as_ref().unwrap(),
); );
todo!(); todo!();