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

0.1.2 #3

Merged
merged 13 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###> mediashare/marathon ###
APP_VERSION=0.1.1
APP_VERSION=0.1.2
###< mediashare/marathon ###

###> symfony/framework-bundle ###
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
make build

- name: Test marathon binary
run: php marathon list
run: php marathon todo

- name: Check infinite loop
run: |
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Marathon GitHub pull requests](https://img.shields.io/github/issues-pr/Mediashare/marathon.svg?style=flat)]()

## Introduction
Marathon is a command-line tool written in PHP and Symfony that empowers you to efficiently **manage times from tasks for your projects**.
Marathon is a command-line tool written in PHP and Symfony that empowers you to efficiently **manage todo-list for your projects**.
It provides a comprehensive solution for maintaining a project-related activities through commit history.
### Features
- **Commit:** Easily associate time entries with project commits to maintain a detailed history of actions taken during the development process.
Expand Down Expand Up @@ -48,7 +48,7 @@ Here are some examples of how to use Marathon:
marathon task:start <?task-id> Starting step of task
marathon task:stop <?task-id> Stoping step of task
marathon task:status <?task-id> Displaying status of task
marathon task:archive <task-id> Archiving the task by ID
marathon task:archive <task-id> Archive the task by ID
marathon task:delete <task-id> Deleting the task by ID

marathon commit:create <?commit-message> Creating new commit into task
Expand Down Expand Up @@ -103,7 +103,7 @@ marathon task:stop # Stop the current step of the task with the default duration
marathon task:stop <?task-id> # Stop the task step with task ID.
marathon task:stop 123 --duration 1h # Stop the task step with ID 123 and updates its duration to 1 hour.
```
#### Archiving or deleting a task
#### Archive or deleting a task
```bash
marathon task:archive <task-id> # Archive the task with ID without stopping the current step.
marathon task:archive 123 # Archive the task with ID 123.
Expand Down Expand Up @@ -134,10 +134,12 @@ Marathon provides several configuration options, edit the configuration file wit
* `--config-datetime-format`: Set the DateTimeFormat for date format displayed.
* `--config-datetime-zone`: Set the DateTimeZone for UTC used.
* `--config-task-dir`: Set the directory path containing task files.
* `--config-editor`: Set the default editor command to use to write commits messages.

```bash
marathon task:start --config-path=/path/to/config/file --config-datetime-format="d/m/Y H:i:s" --config-datetime-zone="Europe/London" --config-task-dir=/path/to/tasks/directory
marathon task:start --config-path=/path/to/config/file --config-datetime-format="d/m/Y H:i:s" --config-datetime-zone="Europe/London" --config-task-dir=/path/to/tasks/directory --config-editor vim
```

Feel free to explore and make the most of Marathon to streamline your project management workflow!

## Contributing
Expand Down
39 changes: 28 additions & 11 deletions bin/marathon
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env php
<?php

use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\NativeHttpClient;

require __DIR__ . '/../vendor/autoload.php';


Expand Down Expand Up @@ -36,39 +40,52 @@ $handlerService = new \Mediashare\Marathon\Service\HandlerService(
$outputService = new \Mediashare\Marathon\Service\OutputService($timestampService);

$commandsLoader = new \Symfony\Component\Console\CommandLoader\FactoryCommandLoader([
'task:list' => function () use ($handlerService, $outputService) {
'task:list' => $list = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskListCommand($handlerService, $outputService);
},
'task:start' => function () use ($handlerService, $outputService) {
'todo' => $list,
'task:start' => $start = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskStartCommand($handlerService, $outputService);
},
'task:stop' => function () use ($handlerService, $outputService) {
'start' => $start,
'task' => $start,
'task:stop' => $stop = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskStopCommand($handlerService, $outputService);
},
'task:status' => function () use ($handlerService, $outputService) {
'stop' => $stop,
'task:status' => $status = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskStatusCommand($handlerService, $outputService);
},
'task:archive' => function () use ($handlerService, $outputService) {
'status' => $status,
'task:archive' => $archive = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskArchiveCommand($handlerService, $outputService);
},
'task:delete' => function () use ($handlerService, $outputService) {
'archive' => $archive,
'task:delete' => $delete = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\TaskDeleteCommand($handlerService, $outputService);
},
'commit:create' => function () use ($handlerService, $outputService) {
'delete' => $delete,
'commit:create' => $commit = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\CommitCreateCommand($handlerService, $outputService);
},
'commit:edit' => function () use ($handlerService, $outputService) {
'commit' => $commit,
'beer' => $commit,
'commit:edit' => $edit = function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\CommitEditCommand($handlerService, $outputService);
},
'edit' => $edit,
'commit:delete' => function () use ($handlerService, $outputService) {
return new Mediashare\Marathon\Command\CommitDeleteCommand($handlerService, $outputService);
},
'git:gitignore' => function () {
'git:gitignore' => $gitignore = function () {
return new Mediashare\Marathon\Command\GitGitignoreCommand();
},
'version:upgrade' => function () {
return new Mediashare\Marathon\Command\VersionUpgradeCommand();
'gitignore' => $gitignore,
'version:upgrade' => $upgrade = function () {
return new Mediashare\Marathon\Command\VersionUpgradeCommand(new NativeHttpClient());
},
'upgrade' => $upgrade,
'update' => $upgrade,
]);
$app->setCommandLoader($commandsLoader);
$app->run();
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"in": "src"
}
],
"banner": "*** Marathon (Version 0.1.1) ***",
"banner": "*** Marathon (Version 0.1.2) ***",
"stub": true,
"dump-autoload": false,
"annotations": false
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@
"symfony/dotenv": "^7.1",
"symfony/flex": "*",
"symfony/framework-bundle": "^7.1",
"symfony/http-client": "^7.1",
"symfony/polyfill-ctype": "^1.28",
"symfony/process": "^7.1",
"symfony/property-access": "^7.1",
"symfony/runtime": "^7.1",
"symfony/serializer": "^7.1",
"symfony/yaml": "^7.1",
"symfony/runtime": "^7.1"
"symfony/yaml": "^7.1"
},
"bin": ["marathon"],
"config": {
Expand Down
176 changes: 174 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified marathon
Binary file not shown.
3 changes: 3 additions & 0 deletions src/Command/CommitCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class CommitCreateCommand extends Command {
protected function configure() {
$this
->setName('commit:create')
->setAliases([
'commit', 'beer',
])
->setDescription('<comment>Creating</comment> new commit into task')
->addArgument('message', InputArgument::OPTIONAL, 'Define a commit <comment>message</comment>', false)
->addOption('editor', 'e', InputOption::VALUE_NONE, 'Open default message <comment>editor</comment>')
Expand Down
3 changes: 3 additions & 0 deletions src/Command/CommitEditCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class CommitEditCommand extends Command {
protected function configure() {
$this
->setName('commit:edit')
->setAliases([
'edit',
])
->setDescription('<comment>Editing</comment> the commit from task')
->addArgument('commit-id', InputArgument::REQUIRED, '<comment>Commit ID</comment>')
->addOption('editor', 'e', InputOption::VALUE_NONE, 'Open default message <comment>editor</comment>')
Expand Down
3 changes: 3 additions & 0 deletions src/Command/GitGitignoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class GitGitignoreCommand extends Command {
protected function configure() {
$this
->setName('git:gitignore')
->setAliases([
'gitignore',
])
->setDescription('Adding <comment>.marathon</comment> rule into <comment>.gitgnore</comment>')
;
}
Expand Down
Loading
Loading