Skip to content

Commit

Permalink
more reasonable arg name diffwith for cmd edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jfding committed Sep 17, 2024
1 parent 2052922 commit 1e8e7b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum Commands {
Edit {
#[arg(short, long)]
#[arg(value_name = "another-taskbox")]
with: Option<String>,
diffwith: Option<String>,
},

/// -> count items in inbox
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ fn main() {
execute!(io::stdout(), DefaultUserShape).expect("failed to set cursor");
}

Some(Commands::Edit { with }) => {
Some(Commands::Edit { diffwith }) => {
let _todo = TaskBox::new(inbox_path.clone()); // then do nothing, to create the file if it doesn't exist

util::edit_box(&inbox_path, with);
util::edit_box(&inbox_path, diffwith);
}

Some(Commands::Count) => {
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pub fn glance_all(inbox_path: &Path) {
println!("{}", &res[6..])
}

pub fn edit_box(inbox_path: &Path, with: Option<String>) {
pub fn edit_box(inbox_path: &Path, diffwith: Option<String>) {
let editor = env::var("EDITOR").unwrap_or("vi".to_string());

if let Some(other) = with {
if let Some(other) = diffwith {
let otherf = if other.ends_with(".md") {
&other
} else {
Expand Down

0 comments on commit 1e8e7b2

Please sign in to comment.