| 1 | package Taskwarrior::Kusarigama::Plugin::Command::Morning; | ||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |
| 3 | # ABSTRACT: run taskwarrior's garbage collection | ||
| 4 | 1 | $Taskwarrior::Kusarigama::Plugin::Command::Morning::VERSION = '0.11.0'; | |
| 5 | |||
| 6 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | extends 'Taskwarrior::Kusarigama::Plugin'; | |
| 12 | 1 | with 'Taskwarrior::Kusarigama::Hook::OnCommand'; | |
| 13 | |||
| 14 | 1 | ▶ | use experimental 'postderef'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | sub on_command { | ||
| 17 | 0 | ▶ | my $self = shift; |
|
Subroutine
on_command: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 18 | |||
| 19 | 0 | system qw/ task rc.gc=on list limit:1 /; | |
| 20 | |||
| 21 | }; | ||
| 22 | |||
| 23 | 1 | 1; | |
| 24 | |||
| 25 | __END__ | ||
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =encoding UTF-8 | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | Taskwarrior::Kusarigama::Plugin::Command::Morning - run taskwarrior's garbage collection | ||
| 34 | |||
| 35 | =head1 VERSION | ||
| 36 | |||
| 37 | version 0.11.0 | ||
| 38 | |||
| 39 | =head1 SYNOPSIS | ||
| 40 | |||
| 41 | $ task morning | ||
| 42 | |||
| 43 | =head1 DESCRIPTION | ||
| 44 | |||
| 45 | By default, taskwarrior runs its garbage | ||
| 46 | collection each time it's run. The problem is, | ||
| 47 | that garbage collection compact | ||
| 48 | (and thus changes) the task ids, so in-between | ||
| 49 | my last C<task list> and now, the ids might | ||
| 50 | be different. That's a pain. But if the garbage | ||
| 51 | collection is not run, hidden tasks and | ||
| 52 | recurring tasks won't be unhidden/created. That's a bigger pain. | ||
| 53 | |||
| 54 | My solution? Disable the garbage collecting, | ||
| 55 | |||
| 56 | $ task config rc.gc off | ||
| 57 | |||
| 58 | but use this command once every morning. | ||
| 59 | |||
| 60 | This command, by the way, is only a glorified | ||
| 61 | |||
| 62 | $ task rc.gc=on list limit:1 | ||
| 63 | |||
| 64 | =head1 AUTHOR | ||
| 65 | |||
| 66 | Yanick Champoux <yanick@cpan.org> | ||
| 67 | |||
| 68 | =head1 COPYRIGHT AND LICENSE | ||
| 69 | |||
| 70 | This software is copyright (c) 2018, 2017 by Yanick Champoux. | ||
| 71 | |||
| 72 | This is free software; you can redistribute it and/or modify it under | ||
| 73 | the same terms as the Perl 5 programming language system itself. | ||
| 74 | |||
| 75 | =cut | ||