Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to control tasks (start/stop) #32

Open
aaronczichon opened this issue Dec 19, 2024 · 3 comments · May be fixed by #44
Open

Add command to control tasks (start/stop) #32

aaronczichon opened this issue Dec 19, 2024 · 3 comments · May be fixed by #44
Labels
enhancement New feature or request

Comments

@aaronczichon
Copy link

Describe the solution you'd like
Currently, as a user, I need to call hours and use s to start/stop a task.
In some cases (e.g. integration with other tools) I want to start or stop tasks via a command instead of an interactive terminal.

Is your feature request related to a problem? Please describe.
For example I want to create an shell script that starts/stops a task. That's currently not possible (or I couldn't find the documentation which is also possible).

Additional context
I also have a proposal for this how this could look like.
Additionally to the existing commands (active, reports, stats) an new command can be added called task.

Add an argument for the command like -id where you need to provide the task id which should be used.
Alternative could be something like -name or so.

Add a second argument -s to define if the task should be started or stopped (same functionality as pressing s in the interactive UI).
If the task is currently running and it's been called with -s an additional parameter -c is required to stop this task. This -c is for comment and you need to provide a comment for the task there.

Here is an example on how this could look like.
With an -id argument to start a task:

hours task -id 1 -s

To stop:

hours task -id -s -c "Working on the new feature xyz"

Bonus could be, if I start a task while another is already running it should stop the other (with the required -c argument) and start the provided one like this assuming there task 1 is currently running:

hours task -id 2 -s -c "Working on the new feature xyz"

This will stop task 1 with the comment Working on the new feature xyz and creates a new session for task 2.

Let me know if you need anything else :)

@aaronczichon aaronczichon added the enhancement New feature or request label Dec 19, 2024
@aaronczichon
Copy link
Author

As an alternative, if a single -s is too confusing there can also be used explicit --start and --stop arguments.

@dhth dhth added this to the v0.4.0 milestone Jan 17, 2025
@dhth
Copy link
Owner

dhth commented Jan 17, 2025

Thanks for the issue, @aaronczichon.

Apologies for the delay in getting back; couldn't manage to find the time for this in the last few weeks.

The feature makes sense to me; I'll add support for this in v0.5.0.

@dhth dhth modified the milestones: v0.4.0, v0.5.0 Jan 17, 2025
@aaronczichon
Copy link
Author

@dhth no worries! That's nice, thanks a lot :)

@dhth dhth linked a pull request Jan 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants