File Coverage

blib/lib/App/bif/OptArgs.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package App::bif::OptArgs;
2              
3             our $VERSION = '0.1.5_5';
4              
5             package # do a little hiding
6             App::bif;
7 55     55   1529663 use strict;
  55         131  
  55         1933  
8 55     55   225 use warnings;
  55         88  
  55         1482  
9 55     55   34204 use OptArgs;
  55         1606625  
  55         441  
10              
11             $OptArgs::COLOUR = 1;
12             $OptArgs::SORT = 1;
13              
14             arg command => (
15             isa => 'SubCmd',
16             required => 1,
17             comment => '',
18             fallback => {
19             name => 'alias',
20             isa => 'ArrayRef',
21             comment => 'run a command alias',
22             greedy => 1,
23             hidden => 1,
24             },
25             );
26              
27             opt help => (
28             isa => 'Bool',
29             alias => 'h',
30             ishelp => 1,
31             comment => 'print a full usage message and exit',
32             );
33              
34             opt debug => (
35             isa => 'Bool',
36             alias => 'D',
37             comment => 'turn on debugging',
38             hidden => 1,
39             );
40              
41             opt no_pager => (
42             isa => 'Bool',
43             comment => 'do not page output',
44             hidden => 1,
45             );
46              
47             opt no_color => (
48             isa => 'Bool',
49             comment => 'do not colorize output',
50             hidden => 1,
51             );
52              
53             opt user_repo => (
54             isa => 'Bool',
55             alias => 'c',
56             comment => 'use the user repository',
57             hidden => 1,
58             );
59              
60             # ------------------------------------------------------------------------
61             # bif check
62             # ------------------------------------------------------------------------
63             subcmd(
64             cmd => 'check',
65             hidden => 1,
66             comment => 'check all changeset UUIDs',
67             );
68              
69             opt verbose => (
70             isa => 'Bool',
71             alias => 'v',
72             comment => 'display YAML differences',
73             );
74              
75             # ------------------------------------------------------------------------
76             # bif init
77             # ------------------------------------------------------------------------
78             subcmd(
79             cmd => 'init',
80             comment => 'initialize a new repository',
81             );
82              
83             opt keep_invalid => (
84             isa => 'Bool',
85             comment => 'Keep invalid updates in the database',
86             hidden => 1,
87             );
88              
89             arg directory => (
90             isa => 'Str',
91             comment => 'hub location',
92             );
93              
94             opt debug_bifsync => (
95             isa => 'Bool',
96             alias => 'E',
97             comment => 'turn on bifsync debugging',
98             hidden => 1,
99             );
100              
101             # ------------------------------------------------------------------------
102             # bif new
103             # ------------------------------------------------------------------------
104             subcmd(
105             cmd => [qw/new/],
106             comment => 'create a new topic',
107             );
108              
109             arg item => (
110             isa => 'SubCmd',
111             required => 1,
112             comment => '',
113             );
114              
115             opt author => (
116             isa => 'Str',
117             comment => 'Author',
118             hidden => 1,
119             );
120              
121             opt email => (
122             isa => 'Str',
123             comment => 'Email',
124             hidden => 1,
125             );
126              
127             opt lang => (
128             isa => 'Str',
129             comment => 'Lang',
130             hidden => 1,
131             );
132              
133             opt locale => (
134             isa => 'Str',
135             comment => 'Locale',
136             hidden => 1,
137             );
138              
139             opt status => (
140             isa => 'Str',
141             alias => 's',
142             comment => 'State',
143             );
144              
145             opt message => (
146             isa => 'Str',
147             alias => 'm',
148             comment => 'Comment',
149             );
150              
151             # ------------------------------------------------------------------------
152             # bif new entity
153             # ------------------------------------------------------------------------
154             subcmd(
155             cmd => [qw/new entity/],
156             comment => 'create a new entity',
157             );
158              
159             arg name => (
160             isa => 'Str',
161             comment => 'The name of the entity',
162             );
163              
164             arg method => (
165             isa => 'Str',
166             comment => 'The contact type (email, phone, etc)',
167             );
168              
169             arg value => (
170             isa => 'Str',
171             comment => 'The contact value',
172             );
173              
174             # ------------------------------------------------------------------------
175             # new hub
176             # ------------------------------------------------------------------------
177             subcmd(
178             cmd => [qw/new hub/],
179             comment => 'create a new hub',
180             );
181              
182             arg name => (
183             isa => 'Str',
184             comment => 'name of organisation\'s hub',
185             );
186              
187             arg location => (
188             isa => 'Str',
189             comment => 'hub location',
190             );
191              
192             arg title => (
193             isa => 'Str',
194             greedy => 1,
195             comment => 'title of organisation\'s hub',
196             );
197              
198             opt default => (
199             isa => 'Bool',
200             comment => 'mark hub as local/default',
201             );
202              
203             # ------------------------------------------------------------------------
204             # bif new identity
205             # ------------------------------------------------------------------------
206             subcmd(
207             cmd => [qw/new identity/],
208             comment => 'create a new identity',
209             );
210              
211             arg name => (
212             isa => 'Str',
213             comment => 'The name of the identity',
214             );
215              
216             arg method => (
217             isa => 'Str',
218             comment => 'The contact type (email, phone, etc)',
219             );
220              
221             arg value => (
222             isa => 'Str',
223             comment => 'The contact value',
224             );
225              
226             opt self => (
227             isa => 'Bool',
228             comment => 'Create a "self" identity',
229             );
230              
231             opt shortname => (
232             isa => 'Str',
233             alias => 's',
234             comment => 'identity initials or short name',
235             );
236              
237             # ------------------------------------------------------------------------
238             # bif new issue
239             # ------------------------------------------------------------------------
240             subcmd(
241             cmd => [qw/new issue/],
242             comment => 'define a problem to be solved',
243             );
244              
245             arg title => (
246             isa => 'Str',
247             comment => 'summary of the issue description',
248             greedy => 1,
249             );
250              
251             opt path => (
252             isa => 'Str',
253             alias => 'p',
254             comment => 'path of the containing project',
255             );
256              
257             opt status => (
258             isa => 'Str',
259             alias => 's',
260             comment => 'Initial status for the task',
261             );
262              
263             # ------------------------------------------------------------------------
264             # bif new project
265             # ------------------------------------------------------------------------
266             subcmd(
267             cmd => [qw/new project/],
268             comment => 'create a new project',
269             );
270              
271             arg path => (
272             isa => 'Str',
273             comment => 'The path of the project',
274             );
275              
276             arg title => (
277             isa => 'Str',
278             comment => 'A short description of the project',
279             greedy => 1,
280             );
281              
282             opt phase => (
283             isa => 'Str',
284             alias => 'p',
285             comment => 'Initial project phase (use instead of --status)',
286             );
287              
288             opt dup => (
289             isa => 'Str',
290             alias => 'd',
291             comment => 'project path to duplicate',
292             );
293              
294             opt issues => (
295             isa => 'Str',
296             alias => 'i',
297             default => '',
298             comment => 'fork, copy or move issues on --dup',
299             );
300              
301             opt tasks => (
302             isa => 'Str',
303             alias => 't',
304             default => '',
305             comment => 'copy or move tasks on --dup',
306             );
307              
308             # ------------------------------------------------------------------------
309             # bif new task
310             # ------------------------------------------------------------------------
311             subcmd(
312             cmd => [qw/new task/],
313             comment => 'define an item of work',
314             );
315              
316             arg title => (
317             isa => 'Str',
318             comment => 'summary of the task description',
319             greedy => 1,
320             );
321              
322             opt path => (
323             isa => 'Str',
324             alias => 'p',
325             comment => 'path of the containing project',
326             );
327              
328             opt status => (
329             isa => 'Str',
330             alias => 's',
331             comment => 'Initial status for the task',
332             );
333              
334             # ------------------------------------------------------------------------
335             # bif new repo
336             # ------------------------------------------------------------------------
337             subcmd(
338             cmd => [qw/new repo/],
339             comment => 'create an new empty repository',
340             );
341              
342             arg directory => (
343             isa => 'Str',
344             required => 1,
345             comment => 'location of repository',
346             );
347              
348             opt config => (
349             isa => 'Bool',
350             comment => 'Create a default repo config file',
351             );
352              
353             # ------------------------------------------------------------------------
354             # bif list
355             # ------------------------------------------------------------------------
356             subcmd(
357             cmd => [qw/list/],
358             comment => 'list topics in the repository',
359             );
360              
361             arg items => (
362             isa => 'SubCmd',
363             comment => '',
364             required => 1,
365             );
366              
367             # ------------------------------------------------------------------------
368             # bif list entities
369             # ------------------------------------------------------------------------
370             subcmd(
371             cmd => [qw/list entities/],
372             comment => 'list entities (contacts)',
373             );
374              
375             # ------------------------------------------------------------------------
376             # list hosts
377             # ------------------------------------------------------------------------
378             subcmd(
379             cmd => [qw/list hosts/],
380             comment => 'list provider host locations',
381             );
382              
383             # ------------------------------------------------------------------------
384             # list hubs
385             # ------------------------------------------------------------------------
386             subcmd(
387             cmd => [qw/list hubs/],
388             comment => 'list hubs and their locations',
389             );
390              
391             # ------------------------------------------------------------------------
392             # bif list identities
393             # ------------------------------------------------------------------------
394             subcmd(
395             cmd => [qw/list identities/],
396             comment => 'list identities (contacts)',
397             );
398              
399             # ------------------------------------------------------------------------
400             # bif list issue-status
401             # ------------------------------------------------------------------------
402             subcmd(
403             cmd => [qw/list task-status/],
404             comment => 'list valid status for tasks',
405             );
406              
407             arg path => (
408             isa => 'Str',
409             comment => 'the path of a project',
410             required => 1,
411             );
412              
413             # ------------------------------------------------------------------------
414             # bif list issues
415             # ------------------------------------------------------------------------
416             subcmd(
417             cmd => [qw/list issues/],
418             comment => 'list issues grouped by project',
419             );
420              
421             opt status => (
422             isa => 'Str',
423             alias => 's',
424             comment => 'limit issues to a specific status',
425             );
426              
427             opt project_status => (
428             isa => 'Str',
429             alias => 'P',
430             comment => 'limit projects by a particular project status',
431             );
432              
433             # ------------------------------------------------------------------------
434             # list plans
435             # ------------------------------------------------------------------------
436             subcmd(
437             cmd => [qw/list plans/],
438             comment => 'list provider commercial offerings',
439             );
440              
441             # ------------------------------------------------------------------------
442             # bif list project-topic
443             # ------------------------------------------------------------------------
444             subcmd(
445             cmd => [qw/list topics/],
446             comment => 'list tasks and issues grouped by project',
447             );
448              
449             opt status => (
450             isa => 'ArrayRef',
451             alias => 's',
452             comment => 'limit topics to a specific status',
453             );
454              
455             opt project_status => (
456             isa => 'Str',
457             alias => 'P',
458             comment => 'limit projects by a particular project status',
459             );
460              
461             # ------------------------------------------------------------------------
462             # bif list project-status
463             # ------------------------------------------------------------------------
464             subcmd(
465             cmd => [qw/list project-status/],
466             comment => 'list valid status for projects',
467             );
468              
469             arg path => (
470             isa => 'Str',
471             comment => 'the path of a project',
472             required => 1,
473             );
474              
475             # ------------------------------------------------------------------------
476             # bif list projects
477             # ------------------------------------------------------------------------
478             subcmd(
479             cmd => [qw/list projects/],
480             comment => 'list projects with topic counts and progress',
481             );
482              
483             arg status => (
484             isa => 'ArrayRef',
485             greedy => 1,
486             comment => 'limit the list by status type(s)',
487             );
488              
489             opt local => (
490             isa => 'Bool',
491             alias => 'l',
492             comment => 'limit the list to projects that synchronise.',
493             );
494              
495             # ------------------------------------------------------------------------
496             # list providers
497             # ------------------------------------------------------------------------
498             subcmd(
499             cmd => [qw/list providers/],
500             comment => 'list registered providers',
501             );
502              
503             # ------------------------------------------------------------------------
504             # list tables
505             # ------------------------------------------------------------------------
506             subcmd(
507             cmd => [qw/list tables/],
508             hidden => 1,
509             comment => 'list database tables',
510             );
511              
512             # ------------------------------------------------------------------------
513             # bif list tasks
514             # ------------------------------------------------------------------------
515             subcmd(
516             cmd => [qw/list tasks/],
517             comment => 'list tasks grouped by project',
518             );
519              
520             opt status => (
521             isa => 'Str',
522             alias => 's',
523             comment => 'limit tasks to a specific status',
524             );
525              
526             opt project_status => (
527             isa => 'Str',
528             alias => 'P',
529             comment => 'limit projects by a particular project status',
530             );
531              
532             # ------------------------------------------------------------------------
533             # bif list task-status
534             # ------------------------------------------------------------------------
535             subcmd(
536             cmd => [qw/list issue-status/],
537             comment => 'list valid status for issues',
538             );
539              
540             arg path => (
541             isa => 'Str',
542             comment => 'the path of a project',
543             required => 1,
544             );
545              
546             # ------------------------------------------------------------------------
547             # bif show
548             # ------------------------------------------------------------------------
549             subcmd(
550             cmd => [qw/show/],
551             comment => "display a topic's current status",
552             );
553              
554             arg item => (
555             isa => 'SubCmd',
556             comment => '',
557             required => 1,
558             fallback => {
559             name => 'id',
560             isa => 'Str',
561             comment => 'topic ID or project PATH',
562             },
563             );
564              
565             opt uuid => (
566             isa => 'Bool',
567             alias => 'U',
568             comment => 'treat ID as a UUID',
569             );
570              
571             opt full => (
572             isa => 'Bool',
573             comment => 'display a more verbose current status',
574             alias => 'f',
575             );
576              
577             # ------------------------------------------------------------------------
578             # bif show entity
579             # ------------------------------------------------------------------------
580             subcmd(
581             cmd => [qw/show entity/],
582             comment => 'display full entity characteristics',
583             );
584              
585             arg id => (
586             isa => 'Int',
587             comment => 'entity ID',
588             required => 1,
589             );
590              
591             # ------------------------------------------------------------------------
592             # bif show identity
593             # ------------------------------------------------------------------------
594             subcmd(
595             cmd => [qw/show identity/],
596             comment => 'display full identity characteristics',
597             );
598              
599             arg id => (
600             isa => 'Int',
601             comment => 'identity ID',
602             required => 1,
603             );
604              
605             # ------------------------------------------------------------------------
606             # bif show hub
607             # ------------------------------------------------------------------------
608             subcmd(
609             cmd => [qw/show hub/],
610             comment => 'summarize the current status of a hub',
611             );
612              
613             arg name => (
614             isa => 'Str',
615             comment => 'hub name',
616             required => 1,
617             );
618              
619             # ------------------------------------------------------------------------
620             # bif show issue
621             # ------------------------------------------------------------------------
622             subcmd(
623             cmd => [qw/show issue/],
624             comment => 'summarize the current status of a issue',
625             );
626              
627             arg id => (
628             isa => 'Int',
629             comment => 'issue ID',
630             required => 1,
631             );
632              
633             # ------------------------------------------------------------------------
634             # show plan
635             # ------------------------------------------------------------------------
636             subcmd(
637             cmd => [qw/show plan/],
638             comment => 'show a provider plan',
639             );
640              
641             arg id => (
642             isa => 'Str',
643             required => 1,
644             comment => 'ID of provider plan',
645             );
646              
647             # ------------------------------------------------------------------------
648             # bif show project
649             # ------------------------------------------------------------------------
650             subcmd(
651             cmd => [qw/show project/],
652             comment => 'display current project status',
653             );
654              
655             arg path => (
656             isa => 'Str',
657             comment => 'a project PATH',
658             required => 1,
659             );
660              
661             # ------------------------------------------------------------------------
662             # bif show table
663             # ------------------------------------------------------------------------
664             subcmd(
665             cmd => [qw/show table/],
666             comment => 'summarize the current status of a table',
667             );
668              
669             arg name => (
670             isa => 'Str',
671             required => 1,
672             comment => 'table name',
673             );
674              
675             # ------------------------------------------------------------------------
676             # bif show task
677             # ------------------------------------------------------------------------
678             subcmd(
679             cmd => [qw/show task/],
680             comment => 'summarize the current status of a task',
681             );
682              
683             arg id => (
684             isa => 'Int',
685             comment => 'task ID',
686             required => 1,
687             );
688              
689             # ------------------------------------------------------------------------
690             # bif show timesheet
691             # ------------------------------------------------------------------------
692             subcmd(
693             cmd => [qw/show timesheet/],
694             comment => 'display time worked per project',
695             );
696              
697             arg date => (
698             isa => 'Str',
699             comment => 'timesheet start date',
700             );
701              
702             opt identity => (
703             isa => 'Str',
704             alias => 'i',
705             comment => 'alternative identity instead of self',
706             );
707              
708             opt number => (
709             isa => 'Int',
710             alias => 'n',
711             comment => 'number of timespans to generate',
712             );
713              
714             opt day => (
715             isa => 'Bool',
716             alias => 'd',
717             comment => 'generate a daily timesheet',
718             );
719              
720             opt week => (
721             isa => 'Bool',
722             alias => 'w',
723             comment => 'generate a weekly timesheet',
724             );
725              
726             opt month => (
727             isa => 'Bool',
728             alias => 'm',
729             comment => 'generate a monthly timesheet',
730             );
731              
732             opt year => (
733             isa => 'Bool',
734             alias => 'y',
735             comment => 'generate a yearly timesheet',
736             );
737              
738             opt rollup => (
739             isa => 'Bool',
740             alias => 'r',
741             comment => 'roll times up into parent project(s)',
742             );
743              
744             # ------------------------------------------------------------------------
745             # bif show change
746             # ------------------------------------------------------------------------
747             subcmd(
748             cmd => [qw/show change/],
749             comment => 'show an update as YAML',
750             );
751              
752             arg uid => (
753             isa => 'Str',
754             required => 1,
755             comment => 'the change cID',
756             );
757              
758             opt diff => (
759             isa => 'Bool',
760             alias => 'd',
761             comment => 'diff actual/expected values (devel only)',
762             );
763              
764             # ------------------------------------------------------------------------
765             # bif show version
766             # ------------------------------------------------------------------------
767             subcmd(
768             cmd => [qw/show version/],
769             comment => 'show version and build informationL',
770             );
771              
772             # ------------------------------------------------------------------------
773             # bif log
774             # ------------------------------------------------------------------------
775             subcmd(
776             cmd => [qw/log/],
777             comment => 'view comments and status history',
778             );
779              
780             arg item => (
781             isa => 'SubCmd',
782             comment => '',
783             fallback => {
784             name => 'id',
785             isa => 'Str',
786             comment => 'topic ID or project PATH',
787             },
788             );
789              
790             opt uuid => (
791             isa => 'Bool',
792             alias => 'U',
793             comment => 'treat arguments as if they are a UUIDs',
794             );
795              
796             opt format => (
797             isa => 'Str',
798             alias => 'f',
799             default => 'full',
800             comment => 'output format: full | short | custom:...',
801             );
802              
803             opt order => (
804             isa => 'Str',
805             alias => 'o',
806             default => 'time',
807             comment => 'output order: time | id | custom:...',
808             );
809              
810             opt short => (
811             isa => 'Bool',
812             alias => 's',
813             comment => 'equivalent to "--format short"',
814             );
815              
816             # ------------------------------------------------------------------------
817             # bif log identity
818             # ------------------------------------------------------------------------
819             subcmd(
820             cmd => [qw/log identity/],
821             comment => 'review history of an identity',
822             );
823              
824             arg id => (
825             isa => 'Str',
826             comment => 'identity ID',
827             required => 1,
828             );
829              
830             # ------------------------------------------------------------------------
831             # bif log entity
832             # ------------------------------------------------------------------------
833             subcmd(
834             cmd => [qw/log entity/],
835             comment => 'review history of an entity',
836             );
837              
838             arg id => (
839             isa => 'Str',
840             comment => 'entity ID',
841             required => 1,
842             );
843              
844             # ------------------------------------------------------------------------
845             # bif log hub
846             # ------------------------------------------------------------------------
847             subcmd(
848             cmd => [qw/log hub/],
849             comment => 'review history of a hub',
850             );
851              
852             arg name => (
853             isa => 'Str',
854             comment => 'hub name',
855             required => 1,
856             );
857              
858             # ------------------------------------------------------------------------
859             # bif log issue
860             # ------------------------------------------------------------------------
861             subcmd(
862             cmd => [qw/log issue/],
863             comment => 'review history of an issue',
864             );
865              
866             arg id => (
867             isa => 'Str',
868             comment => 'issue ID',
869             required => 1,
870             );
871              
872             # ------------------------------------------------------------------------
873             # bif log project
874             # ------------------------------------------------------------------------
875             subcmd(
876             cmd => [qw/log project/],
877             comment => 'review history of a project',
878             );
879              
880             arg path => (
881             isa => 'Str',
882             comment => 'project PATH or ID',
883             required => 1,
884             );
885              
886             # ------------------------------------------------------------------------
887             # bif log task
888             # ------------------------------------------------------------------------
889             subcmd(
890             cmd => [qw/log task/],
891             comment => 'review history of a task',
892             );
893              
894             arg id => (
895             isa => 'Str',
896             comment => 'task ID',
897             required => 1,
898             );
899              
900             # ------------------------------------------------------------------------
901             # bif update
902             # ------------------------------------------------------------------------
903             subcmd(
904             cmd => [qw/update/],
905             comment => 'comment on or modify a topic',
906             );
907              
908             arg id => (
909             isa => 'SubCmd',
910             required => 1,
911             comment => 'topic ID or project PATH',
912             fallback => {
913             name => 'id',
914             isa => 'Str',
915             comment => 'topic ID or project PATH',
916             },
917             );
918              
919             opt uuid => (
920             isa => 'Bool',
921             alias => 'U',
922             comment => 'treat ID as a UUID',
923             );
924              
925             opt author => (
926             isa => 'Str',
927             comment => 'Author',
928             hidden => 1,
929             );
930              
931             opt lang => (
932             isa => 'Str',
933             comment => 'Lang',
934             hidden => 1,
935             );
936              
937             opt locale => (
938             isa => 'Str',
939             comment => 'Locale',
940             hidden => 1,
941             );
942              
943             opt message => (
944             isa => 'Str',
945             comment => 'Comment',
946             alias => 'm',
947             );
948              
949             opt reply => (
950             isa => 'Str',
951             comment => 'reply to a change cID',
952             alias => 'r',
953             );
954              
955             opt title => (
956             isa => 'Str',
957             alias => 't',
958             comment => 'Title'
959             );
960              
961             # ------------------------------------------------------------------------
962             # bif update identity
963             # ------------------------------------------------------------------------
964             subcmd(
965             cmd => [qw/update identity/],
966             comment => 'update an identity',
967             );
968              
969             arg id => (
970             isa => 'Int',
971             required => 1,
972             comment => 'identity ID',
973             );
974              
975             opt shortname => (
976             isa => 'Str',
977             alias => 's',
978             comment => 'identity initials or short name',
979             );
980              
981             # ------------------------------------------------------------------------
982             # bif update entity
983             # ------------------------------------------------------------------------
984             subcmd(
985             cmd => [qw/update entity/],
986             comment => 'update an entity',
987             );
988              
989             arg id => (
990             isa => 'Int',
991             required => 1,
992             comment => 'entity ID',
993             );
994              
995             # ------------------------------------------------------------------------
996             # bif update hub
997             # ------------------------------------------------------------------------
998             subcmd(
999             cmd => [qw/update hub/],
1000             comment => 'update a hub',
1001             );
1002              
1003             arg id => (
1004             isa => 'Int',
1005             required => 1,
1006             comment => 'hub ID',
1007             );
1008              
1009             opt name => (
1010             isa => 'Str',
1011             alias => 'n',
1012             comment => 'hub name'
1013             );
1014              
1015             opt title => (
1016             isa => 'Str',
1017             alias => 't',
1018             comment => 'hub title'
1019             );
1020              
1021             # ------------------------------------------------------------------------
1022             # bif update issue
1023             # ------------------------------------------------------------------------
1024             subcmd(
1025             cmd => [qw/update issue/],
1026             comment => 'update an issue',
1027             );
1028              
1029             arg id => (
1030             isa => 'Int',
1031             required => 1,
1032             comment => 'issue ID',
1033             );
1034              
1035             arg status => (
1036             isa => 'Str',
1037             comment => 'topic status',
1038             );
1039              
1040             opt title => (
1041             isa => 'Str',
1042             alias => 't',
1043             comment => 'Title',
1044             );
1045              
1046             # ------------------------------------------------------------------------
1047             # bif update project
1048             # ------------------------------------------------------------------------
1049             subcmd(
1050             cmd => [qw/update project/],
1051             comment => 'update an project',
1052             );
1053              
1054             arg path => (
1055             isa => 'Str',
1056             required => 1,
1057             comment => 'project path',
1058             );
1059              
1060             arg status => (
1061             isa => 'Str',
1062             comment => 'topic status',
1063             );
1064              
1065             opt title => (
1066             isa => 'Str',
1067             alias => 't',
1068             comment => 'Title',
1069             );
1070              
1071             # ------------------------------------------------------------------------
1072             # bif update task
1073             # ------------------------------------------------------------------------
1074             subcmd(
1075             cmd => [qw/update task/],
1076             comment => 'update an task',
1077             );
1078              
1079             arg id => (
1080             isa => 'Int',
1081             required => 1,
1082             comment => 'task ID',
1083             );
1084              
1085             arg status => (
1086             isa => 'Str',
1087             comment => 'topic status',
1088             );
1089              
1090             opt title => (
1091             isa => 'Str',
1092             alias => 't',
1093             comment => 'Title',
1094             );
1095              
1096             # ------------------------------------------------------------------------
1097             # bif drop
1098             # ------------------------------------------------------------------------
1099             subcmd(
1100             cmd => [qw/drop/],
1101             comment => 'remove an item from the database',
1102             hidden => 1,
1103             );
1104              
1105             arg item => (
1106             isa => 'SubCmd',
1107             required => 1,
1108             comment => 'topic ID or project PATH',
1109             );
1110              
1111             opt force => (
1112             isa => 'Bool',
1113             alias => 'f',
1114             comment => 'Do not ask for confirmation',
1115             );
1116              
1117             # ------------------------------------------------------------------------
1118             # bif drop hub
1119             # ------------------------------------------------------------------------
1120             subcmd(
1121             cmd => [qw/drop hub/],
1122             comment => 'remove a hub',
1123             );
1124              
1125             arg name => (
1126             isa => 'Str',
1127             required => 1,
1128             comment => 'hub name (TODO: or ID)',
1129             );
1130              
1131             # ------------------------------------------------------------------------
1132             # bif drop issue
1133             # ------------------------------------------------------------------------
1134             subcmd(
1135             cmd => [qw/drop issue/],
1136             comment => 'remove an issue',
1137             );
1138              
1139             arg id => (
1140             isa => 'Int',
1141             required => 1,
1142             comment => 'issue ID',
1143             );
1144              
1145             # ------------------------------------------------------------------------
1146             # bif drop project
1147             # ------------------------------------------------------------------------
1148             subcmd(
1149             cmd => [qw/drop project/],
1150             comment => 'remove a project',
1151             );
1152              
1153             arg path => (
1154             isa => 'Str',
1155             required => 1,
1156             comment => 'project PATH or ID',
1157             );
1158              
1159             # ------------------------------------------------------------------------
1160             # bif drop task
1161             # ------------------------------------------------------------------------
1162             subcmd(
1163             cmd => [qw/drop task/],
1164             comment => 'remove a task',
1165             );
1166              
1167             arg id => (
1168             isa => 'Int',
1169             required => 1,
1170             comment => 'task ID',
1171             );
1172              
1173             # ------------------------------------------------------------------------
1174             # bif drop change
1175             # ------------------------------------------------------------------------
1176             subcmd(
1177             cmd => [qw/drop change/],
1178             comment => 'remove a change',
1179             );
1180              
1181             arg uid => (
1182             isa => 'Int',
1183             required => 1,
1184             comment => 'change cID',
1185             );
1186              
1187             # ------------------------------------------------------------------------
1188             # bif pull
1189             # ------------------------------------------------------------------------
1190             subcmd(
1191             cmd => [qw/pull/],
1192             comment => 'import topics from elsewhere',
1193             );
1194              
1195             arg item => (
1196             isa => 'SubCmd',
1197             comment => '',
1198             required => 1,
1199             );
1200              
1201             opt debug_bifsync => (
1202             isa => 'Bool',
1203             alias => 'E',
1204             hidden => 1,
1205             comment => 'turn on bifsync debugging',
1206             );
1207              
1208             # ------------------------------------------------------------------------
1209             # bif pull identity
1210             # ------------------------------------------------------------------------
1211              
1212             subcmd(
1213             cmd => [qw/pull identity/],
1214             comment => 'import an identity from a repository',
1215             );
1216              
1217             arg location => (
1218             isa => 'Str',
1219             required => 1,
1220             comment => 'location of identity repository',
1221             );
1222              
1223             # For the moment just handle self identities.
1224             #arg identity => (
1225             # isa => 'Str',
1226             # comment => 'location of identity repository',
1227             #);
1228              
1229             opt self => (
1230             isa => 'Bool',
1231             comment => 'register identity as "myself" after import',
1232             );
1233              
1234             # ------------------------------------------------------------------------
1235             # pull hub
1236             # ------------------------------------------------------------------------
1237              
1238             subcmd(
1239             cmd => [qw/pull hub/],
1240             comment => 'import project list from a hub repository',
1241             );
1242              
1243             arg location => (
1244             isa => 'Str',
1245             required => 1,
1246             comment => 'location of a remote repository',
1247             );
1248              
1249             # ------------------------------------------------------------------------
1250             # bif pull project
1251             # ------------------------------------------------------------------------
1252              
1253             subcmd(
1254             cmd => [qw/pull project/],
1255             comment => 'import projects from a hub',
1256             );
1257              
1258             arg path => (
1259             isa => 'Str',
1260             required => 1,
1261             comment => 'path(s) of the project(s) to be imported',
1262             );
1263              
1264             opt debug_bifsync => (
1265             isa => 'Bool',
1266             alias => 'E',
1267             comment => 'turn on bifsync debugging',
1268             hidden => 1,
1269             );
1270              
1271             opt hub => (
1272             isa => 'Str',
1273             comment => 'a specific hub to pull from',
1274             );
1275              
1276             # ------------------------------------------------------------------------
1277             # pull provider
1278             # ------------------------------------------------------------------------
1279             subcmd(
1280             cmd => [qw/pull provider/],
1281             comment => 'import plans from a provider',
1282             );
1283              
1284             arg location => (
1285             isa => 'Str',
1286             required => 1,
1287             comment => 'management location of provider',
1288             );
1289              
1290             # ------------------------------------------------------------------------
1291             # bif push
1292             # ------------------------------------------------------------------------
1293             subcmd(
1294             cmd => [qw/push/],
1295             comment => 'export topics to somewhere else',
1296             );
1297              
1298             arg item => (
1299             isa => 'SubCmd',
1300             comment => '',
1301             required => 1,
1302             );
1303              
1304             opt message => (
1305             isa => 'Str',
1306             comment => 'optional comment for the associated change',
1307             alias => 'm',
1308             );
1309              
1310             # ------------------------------------------------------------------------
1311             # push hub
1312             # ------------------------------------------------------------------------
1313             subcmd(
1314             cmd => [qw/push hub/],
1315             comment => 'export a hub to a provider host',
1316             );
1317              
1318             arg name => (
1319             isa => 'Str',
1320             required => 1,
1321             comment => 'name of your organisation\'s hub',
1322             );
1323              
1324             arg hosts => (
1325             isa => 'ArrayRef',
1326             required => 1,
1327             greedy => 1,
1328             comment => 'provider host address(es)',
1329             );
1330              
1331             # ------------------------------------------------------------------------
1332             # bif push issue
1333             # ------------------------------------------------------------------------
1334             subcmd(
1335             cmd => [qw/push issue/],
1336             comment => 'push an issue to another project',
1337             );
1338              
1339             arg id => (
1340             isa => 'Int',
1341             required => 1,
1342             comment => 'issue ID',
1343             );
1344              
1345             arg path => (
1346             isa => 'ArrayRef',
1347             required => 1,
1348             greedy => 1,
1349             comment => 'path(s) of the destination project(s)',
1350             );
1351              
1352             opt err_on_exists => (
1353             isa => 'Bool',
1354             comment => 'raise an error when issue exists at destination',
1355             hidden => 1,
1356             );
1357              
1358             # ------------------------------------------------------------------------
1359             # bif push project
1360             # ------------------------------------------------------------------------
1361             subcmd(
1362             cmd => [qw/push project/],
1363             comment => 'export a project to a hub',
1364             );
1365              
1366             arg path => (
1367             isa => 'Str',
1368             required => 1,
1369             comment => 'path of the project to export',
1370             );
1371              
1372             arg hub => (
1373             isa => 'Str',
1374             required => 1,
1375             comment => 'destination location URI',
1376             );
1377              
1378             opt debug_bifsync => (
1379             isa => 'Bool',
1380             alias => 'E',
1381             comment => 'turn on bifsync debugging',
1382             hidden => 1,
1383             );
1384              
1385             # ------------------------------------------------------------------------
1386             # signup
1387             # ------------------------------------------------------------------------
1388             subcmd(
1389             cmd => [qw/signup/],
1390             comment => 'sign up with a hub provider',
1391             hidden => 1,
1392             );
1393              
1394             arg name => (
1395             isa => 'Str',
1396             required => 1,
1397             comment => 'hub name',
1398             );
1399              
1400             arg plan => (
1401             isa => 'Str',
1402             required => 1,
1403             comment => 'provider plan name',
1404             );
1405              
1406             opt debug_bs => (
1407             isa => 'Bool',
1408             alias => 'E',
1409             comment => 'turn on bifsync debugging',
1410             hidden => 1,
1411             );
1412              
1413             # ------------------------------------------------------------------------
1414             # bif sync
1415             # ------------------------------------------------------------------------
1416             subcmd(
1417             cmd => [qw/sync/],
1418             comment => 'exchange changes with a hub',
1419             );
1420              
1421             opt path => (
1422             isa => 'ArrayRef',
1423             alias => 'p',
1424             comment => 'limit sync to a particular project',
1425             );
1426              
1427             opt hub => (
1428             isa => 'ArrayRef',
1429             alias => 'H',
1430             comment => 'limit sync to a particular hub',
1431             );
1432              
1433             opt message => (
1434             isa => 'Str',
1435             alias => 'm',
1436             default => '',
1437             hidden => 1,
1438             comment => 'message for multiple test script changes / second ',
1439             );
1440              
1441             opt debug_bifsync => (
1442             isa => 'Bool',
1443             alias => 'E',
1444             comment => 'turn on bifsync debugging',
1445             hidden => 1,
1446             );
1447              
1448             # ------------------------------------------------------------------------
1449             # bif upgrade
1450             # ------------------------------------------------------------------------
1451             subcmd(
1452             cmd => [qw/upgrade/],
1453             comment => 'upgrade a repository',
1454             hidden => 1,
1455             );
1456              
1457             arg directory => (
1458             isa => 'Str',
1459             comment => 'location if this is a hub upgrade',
1460             );
1461              
1462             opt force => (
1463             isa => 'Bool',
1464             alias => 'f',
1465             comment => 'force an upgrade, even if to same version',
1466             );
1467              
1468             # ------------------------------------------------------------------------
1469             # bif sql
1470             # ------------------------------------------------------------------------
1471             subcmd(
1472             cmd => [qw/sql/],
1473             comment => 'run an SQL command against the database',
1474             hidden => 1,
1475             );
1476              
1477             arg statement => (
1478             isa => 'Str',
1479             comment => 'SQL statement text',
1480             greedy => 1,
1481             );
1482              
1483             opt noprint => (
1484             isa => 'Bool',
1485             comment => 'do not print output but return a data structure',
1486             alias => 'n',
1487             );
1488              
1489             opt test => (
1490             isa => 'Bool',
1491             comment => 'use Test::More::diag to output rows',
1492             alias => 't',
1493             );
1494              
1495             opt write => (
1496             isa => 'Bool',
1497             comment => 'run with a writeable database (default is read-only)',
1498             alias => 'w',
1499             );
1500              
1501             # ------------------------------------------------------------------------
1502             # wlog
1503             # ------------------------------------------------------------------------
1504             subcmd(
1505             cmd => [qw/wlog/],
1506             comment => 'review entries in the work buffer',
1507             );
1508              
1509             opt identity => (
1510             isa => 'Str',
1511             alias => 'i',
1512             comment => 'alternative identity instead of self',
1513             );
1514              
1515             opt long => (
1516             isa => 'Bool',
1517             alias => 'l',
1518             comment => 'print multiple-line email-style work entries',
1519             );
1520              
1521             # ------------------------------------------------------------------------
1522             # bif work
1523             # ------------------------------------------------------------------------
1524             subcmd(
1525             cmd => [qw/work/],
1526             comment => 'work on a topic',
1527             );
1528              
1529             arg id => (
1530             isa => 'Str',
1531             comment => 'topic ID or PATH to work on',
1532             );
1533              
1534             arg comment => (
1535             isa => 'Str',
1536             greedy => 1,
1537             comment => 'comment to record with this work',
1538             );
1539              
1540             opt at => (
1541             isa => 'Str',
1542             alias => 'a',
1543             default => sub {
1544             my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
1545             localtime(time);
1546             return sprintf(
1547             '%0.4d-%0.2d-%0.2d %0.2d:%0.2d:%0.2d',
1548             $year + 1900,
1549             $mon + 1, $mday, $hour, $min, $sec
1550             );
1551             },
1552             comment => 'start or stop time: [yyyy-mm-dd] hh:mm',
1553             );
1554              
1555             opt force => (
1556             isa => 'Bool',
1557             alias => 'f',
1558             comment => 'force work when working something else',
1559             );
1560              
1561             opt not_billable => (
1562             isa => 'Bool',
1563             alias => 'B',
1564             default => 0,
1565             comment => 'do not record this work on next update',
1566             );
1567              
1568             1;
1569             __END__