tummychow / git-absorb

git commit --fixup, but automatic
https://crates.io/crates/git-absorb
BSD 3-Clause "New" or "Revised" License
3.35k stars 59 forks source link

Use get_flag instead of contains_id #105

Closed Pi-Cla closed 5 months ago

Pi-Cla commented 5 months ago

Turns out get_flag is the intended command when checking whether a flag is present rather than contains_id

tummychow commented 5 months ago

hm. so they're interchangeable in this case, but get_flag is idiomatic?

Pi-Cla commented 5 months ago

hm. so they're interchangeable in this case, but get_flag is idiomatic?

The language was really confusing because contains_id is described as "Check if values are present for the argument or group id" and so I thought that was the intended command. But when I later reread the migration message today it says

With ArgAction::SetTrue becoming the new flag default in clap v4, flags will always be present.

Meaning is_present() would actually always return true, so get_flag() is the intended command.