Skip to content

Commit

Permalink
clarify arguments for :TimerStart
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Nov 30, 2023
1 parent c7f91ae commit 7ff55b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ A simple, customizable [pomodoro](https://en.wikipedia.org/wiki/Pomodoro_Techniq

### Commands

- `:TimerStart TIMELIMIT [NAME]` to start a new timer. For example, `:TimerStart 25m Work` to start a timer for 25 minutes called "Work". Currently the time limit can only be specified in hours, minutes, or seconds, such as `10m` for "10 minutes" or `10s` for "10 seconds".
- `:TimerStart TIMELIMIT [NAME]` to start a new timer.

The time limit can be specified in hours, minutes, seconds, or a combination of those, and *shouldn't include any spaces*. For example:

- `:TimerStart 25m Work` to start a timer for 25 minutes called "Work".
- `:TimerStart 10s` to start a timer for 10 seconds.
- `:TimerStart 1h30m` to start a timer for an hour and a half.

pomo.nvim will recognize multiple forms of the time units, such as "m", "min", "minute", or "minutes" for minutes.

- `:TimerStop [TIMERID]` to stop a running timer, e.g. `:TimerStop 1`. If no ID is given, the latest timer is stopped.

## Setup
Expand Down
2 changes: 1 addition & 1 deletion lua/pomo/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local M = {}
M.register_commands = function()
vim.api.nvim_create_user_command("TimerStart", function(data)
if data.fargs == nil or #data.fargs == 0 or #data.fargs > 2 then
return log.error "Invalid arguments.\nUsage: TimerStart TIMELIMIT [NAME]"
return log.error "Invalid number arguments, expected 2.\nUsage: TimerStart TIMELIMIT [NAME]"
end

local time_arg = string.lower(data.fargs[1])
Expand Down

0 comments on commit 7ff55b0

Please sign in to comment.