feat(archive): duration syntax and confirmation prompt
Problem: `:Pending archive` accepted only a bare integer for days and silently deleted tasks with no confirmation, risking accidental data loss. Solution: Accept duration strings (`7d`, `3w`, `2m`) via `parse.parse_duration_to_days()`, show a `vim.ui.input` confirmation prompt before removing tasks, and skip the prompt when zero tasks match.
This commit is contained in:
parent
8cfdafe464
commit
cfcaaca28b
4 changed files with 220 additions and 25 deletions
|
|
@ -203,6 +203,9 @@ end, {
|
|||
end
|
||||
return filtered
|
||||
end
|
||||
if cmd_line:match('^Pending%s+archive%s') then
|
||||
return filter_candidates(arg_lead, { '7d', '2w', '30d', '3m', '6m', '1y' })
|
||||
end
|
||||
if cmd_line:match('^Pending%s+done%s') then
|
||||
local store = require('pending.store')
|
||||
local s = store.new(store.resolve_path())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue