Skip to content

Commit

Permalink
Fixes make parameter -m optional in vault commit #29
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhexists committed Dec 23, 2023
1 parent f111b6c commit c375352
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/commands/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ pub fn log() -> io::Result<()> {
println!("Author: {}", commit.author);
println!("Date: {}", commit.date);
println!();
println!(" {}", commit.message);
if commit.message == "" {
println!(" \u{001b}[34m[No Commit Message] \u{001b}[0m");
} else {
println!(" {}", commit.message);
}
println!();
}
Ok(())
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
mod commands;
mod core;
mod utils;
use std::env;
use crate::commands::init::init;
use clap::{Parser, Subcommand};
use commands::delete::delete;
use commands::log::log;
use commands::revert::revert;
use commands::{cat::cat, commit::commit, create::create, switch::switch};
use std::env;

#[derive(Parser)]
#[command(author, version, about, long_about=None)]
Expand All @@ -24,7 +24,7 @@ enum Arguments {
Init,
/// Commit files to current branch
Commit {
#[arg(short, long)]
#[arg(short, long, default_value = "")]
message: String,
},
/// Create a new branch with given name
Expand All @@ -39,7 +39,7 @@ enum Arguments {
Log,
/// Get back to any specified point of your repository!
Revert {
#[arg(short, long)]
#[arg(short, long, default_value = "1")]
level: usize,
path: String,
},
Expand Down

0 comments on commit c375352

Please sign in to comment.