-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_accurev
887 lines (758 loc) · 26.2 KB
/
_accurev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
#compdef accurev
# redefine _accurev.
local curcontext="$curcontext" cmd args expl ret=1
(( $+functions[_accurev] )) ||
_accurev() {
_arguments -s \
'*::accurev command:_accurev_command'
}
# define accurev command dispatch function.
(( $+functions[_accurev_command] )) ||
_accurev_command() {
if (( ! $+_accurev_cmds )); then
typeset -gA _accurev_cmds
_accurev_cmds=(
${=${${(L)${(f)"$(accurev help all)"}/^([[:upper:]]##)}/(#b)([[:lower:]]##)(#B)/$match[1] :$match[1]:}}
authmethod :authmethod:
help :help:
)
fi
if (( CURRENT == 1 )); then
_tags commands && { compadd "$@" -k _accurev_cmds || compadd "$@" ${(s.:.)_accurev_cmds} }
else
args=( '(-)'{--help,-h}'[show help message]' )
cmd="${${(k)_accurev_cmds[(R)*:$words[1]:*]}:-${(k)_accurev_cmds[(i):$words[1]:]}}"
if (( $#cmd )); then
curcontext="${curcontext%:*:*}:accurev-${cmd}:"
_call_function ret _accurev_$cmd || _message 'no more arguments'
else
_message "unknown accurev command: $words[1]"
fi
return ret
fi
}
# define completion functions for each accurev command
(( $+functions[_accurev_addmember] )) ||
_accurev_addmember() {
args+=(
'1:user or group name:'
'2:group name:'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_add] )) ||
_accurev_add() {
args+=(
'-c[Commit message]:comment:'
'-E[Set the element type of the version to be created]:element type:((text ptext binary serial parallel))'
'(*)-l[file containing names of elements to be processed]:list file:_files'
'-R[recurse into all subdirectories]'
'-x[select external elements]'
'-fi[include even if ignored]'
'-s[create symlinks]'
'(-l)*:files or directories:_files'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_anchor] )) ||
_accurev_anchor() {
args+=(
'-c[Commit message]:comment:'
'-E[Set the element type of the version to be created]:element type:((text ptext binary serial parallel))'
'-n[select modified but not default elements]'
'-R[recurse into subdirectories]'
'(*)-l[file containing names of elements to be processed]:list file:_files'
'(-l)*:element list:_files'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_anc] )) ||
_accurev_anc() {
args+=(
'(-j -J -1 -c)-c[common ancestor]'
'*-f-[format]:format:((x\:XML))'
'(-J -c -j)-j[determine the corresponding basis version]'
'(-j -c -J)-J[determine basis or merged direct ancestor]'
'(-j -J -c -1)-1[version in the stream just before]'
'(-v)-v[version to work with]:version:'
'*:element:_files -/'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_annotate] )) ||
_accurev_annotate() {
args+=(
'(-v)-v[Version specifier]:version specifier:'
'*-f-[Format]:format:((t\:Transaction u\:User d\:Date v\:Version))'
'*:element:_files -/'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_archive] )) ||
_accurev_archive() {
args+=(
'-i[dry run]'
'-c[comment]:comment:'
'*-E[element type]:types:((text ptext binary all))'
'-s[stream]:stream:'
'(-a)*-I[Categories to include]:category:((depot snapshots deactivated))'
'(-I)-a[archive all versions]'
'-t[time specifier]:time specifier:'
'-R[recursive operation]'
'-Fx[list file is XML]'
'(*)-l[list file]:file:_files -/'
'*:element:_files -/'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_authmethod] )) ||
_accurev_authmethod() {
args+=(
'1:method:((accurev_login traditional custom))'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_backup] )) ||
_accurev_backup() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_cat] )) ||
_accurev_cat() {
args+=(
'-v[Version specifier]:version:'
'-p[perform the operation using this depot]:depot:'
'(*)-e[specify integer element-ID]:element id:'
'*:element:_accurev_element'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_chdepot] )) ||
_accurev_chdepot() {
args+=(
'-p[perform the operation using this depot]:depot:'
'(* -kd)-ke[Enable depot-wide exclusive file locking]'
'(* -ke)-kd[Disable depot-wide exclusive file locking]'
'*:new depot name:'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_chgroup] )) ||
_accurev_chgroup() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_chmod] )) ||
_accurev_chmod() {
_arguments -s \
'-c[Comment to associate with the transaction]:comment:_accurev_comment' \
'*:element:_accurev_element' \
}
(( $+functions[_accurev_chpasswd] )) ||
_accurev_chpasswd() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_chref] )) ||
_accurev_chref() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_chslice] )) ||
_accurev_chslice() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_chstream] )) ||
_accurev_chstream() {
args+=(
'-s[stream to work with]:stream:'
'(*)-b[new backing stream]:backing stream:'
'(*)-t[new basis time for the stream]:time:'
)
args+=( '*:NEW NAME:_files -/' )
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_chuser] )) ||
_accurev_chuser() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_chws] )) ||
_accurev_chws() {
args+=(
'(-s -w)-w[Workspace to change]:workspace:'
'(-s -w)-s[Workspace to change that belongs to another user]:workspace:'
'(*)-l[Location where the tree is moved to]:location:_path_files'
'(*)-b[Backing stream to use]:stream:'
'(*)-m[New hostname for the working tree]'
'(*)-e[Line terminator style]:line terminator:((d\:default u\:unix w\:windows))'
'(*)-k[Kind of workspace]:workspace locking:((d\:default e\:exclusive a\:anchor))'
)
args+=( '*:NEW NAME:_files -/' )
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_clear] )) ||
_accurev_clear() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_co] )) ||
_accurev_co() {
_arguments -s \
'-t[transaction to reverse]:transaction:_accurev_transaction' \
'(-t)-v[Select a particular version]:version:_accurev_version_spec' \
'(-e -t)-l[file containing names of elements to be processed]:list file:_accurev_l' \
'(-l -t)-e[specify integer element-ID]:element id:_accurev_element_id' \
'(-t)-n[select modified non-member elements]' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_cpkadd] )) ||
_accurev_cpkadd() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_cpkdepend] )) ||
_accurev_cpkdepend() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_cpkdescribe] )) ||
_accurev_cpkdescribe() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_cpkremove] )) ||
_accurev_cpkremove() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_defunct] )) ||
_accurev_defunct() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_diag] )) ||
_accurev_diag() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_diff] )) ||
_accurev_diff() {
args+=(
'(* -b -I -B -G -j)-a[all elements in the workspace]'
'(-n -d)-d[only elements in the default group]'
'(-k -m)-k[only elements that have been kept]::Pattern:'
'(-k -m)-m[only elements that have been modified]'
'(-n -d)-n[only elements that have been modified and not in the default group]'
'-o[only elements with overlaps]'
'-p[only elements pending promotion]'
'(-1 -V -b)-b[diff from backing stream]'
'-v[diff from a particular version]:version spec:'
'(-1 -V -b -j)-V[diff to a particular version]:other version spec other:'
'(-V -1)-j[diff from the cbasis of the other specified version]'
'(-1 -V -b -j)-1[diff from the previous occupant]'
'-B[ignore blanks]'
'-c[Context diff]'
'-i[report IDs of the versions w/o diffing]'
'-I[ignore case]'
'-w[ignore whitespace]'
'-W[ignore existant changed whitespace; report new or removed]'
'(-a -c -w -W -I -B -G)-G[use a graphical tool]'
)
args+=( '*:File:_files -/' )
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_excl] )) ||
_accurev_excl() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_files] )) ||
_accurev_files() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_getconfig] )) ||
_accurev_getconfig() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_getpref] )) ||
_accurev_getpref() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_help] )) ||
_accurev_help() {
_arguments -s \
'*::accurev command:_accurev_command' \
}
(( $+functions[_accurev_hist] )) ||
_accurev_hist() {
args+=(
'(* -e -p -a)-a[all elements in the depot]'
'(* -e -p -a)-e[element id]:element:'
'(* -e -p -a)-p[depot to work with]:depot:'
'*-f-[format]:format:((e\:Expanded v\:Verbose s\:Status t\:Transaction x\:XML))'
'-t[transaction range]:range:'
'-k-[only show specific transaction types]:type:(chstream keep promote mkstream purge add defunct move)'
'-u[only transactions from user]:user:'
'(-s -p)-s[stream to work with]:stream:'
'-c[only transactions with this comment]'
)
args+=('*:file:_files -/')
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_incl] )) ||
_accurev_incl() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_incldo] )) ||
_accurev_incldo() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_info] )) ||
_accurev_info() {
args+=(
'-v[verbose output]'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_ismember] )) ||
_accurev_ismember() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_issuediff] )) ||
_accurev_issuediff() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_issuelist] )) ||
_accurev_issuelist() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_keep] )) ||
_accurev_keep() {
_arguments -s \
'-c[Comment to associate with the transaction]:comment:_accurev_comment' \
'-E[Set the element type of the version to be created]:element type:_accurev_element_type' \
'-l[file containing names of elements to be processed]:list file:_accurev_l' \
'-d[select the members of the default group]' \
'-m[select modified elements]' \
'-n[select modified non-member elements]' \
'-O[Allows a keep operation on an element with a modification time earlier than the modification time of the ancestor]' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_licenses] )) ||
_accurev_licenses() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_ln] )) ||
_accurev_ln() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_lock] )) ||
_accurev_lock() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_login] )) ||
_accurev_login() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_logout] )) ||
_accurev_logout() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_lsacl] )) ||
_accurev_lsacl() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_lsrules] )) ||
_accurev_lsrules() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_merge] )) ||
_accurev_merge() {
args+=(
'(-G -B)-B[dry run w/ entire backing chain]'
'(-G -i)-i[dry run]'
'(-i -B -G)-G[use a graphical tool]'
'(-i -B -s -I -K)-K[auto keep]'
'(* -I -o)-o[merge overlaps]'
'(-s -I -O)-O[always use the workspace version]'
'(-O -o -v -s -K)-I[merge by change package]:issue number:'
'(-s -v)-v[merge from a particular version]:version spec:'
'(-v -s)-s[use this stream as a basis]:stream:'
)
args+=('*:file:_files -/')
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_mergelist] )) ||
_accurev_mergelist() {
args+=(
'-s[source stream]:stream:'
'-S[destination stream]:stream:'
'-o[overlaps only]'
'-d[only default group in source]'
'-f-[format]:format:((l\:Locations x\:XML))'
'(*)-l[file containing names of elements to be processed]:list file:_files -/'
'*:file:_files -/'
)
_arguments -s "$args[@]" && ret=0
}
(( $+functions[_accurev_mkdepot] )) ||
_accurev_mkdepot() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkgroup] )) ||
_accurev_mkgroup() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mklinks] )) ||
_accurev_mklinks() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkref] )) ||
_accurev_mkref() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkreplica] )) ||
_accurev_mkreplica() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkrules] )) ||
_accurev_mkrules() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mksnap] )) ||
_accurev_mksnap() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkstream] )) ||
_accurev_mkstream() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mktrig] )) ||
_accurev_mktrig() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkuser] )) ||
_accurev_mkuser() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_mkws] )) ||
_accurev_mkws() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_move] )) ||
_accurev_move() {
_message -e messages 'Not complete'
_arguments -s \
'-e[specify integer element-ID]:element id:_accurev_element_id' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_name] )) ||
_accurev_name() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_patch] )) ||
_accurev_patch() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_patchlist] )) ||
_accurev_patchlist() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_pop] )) ||
_accurev_pop() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_promote] )) ||
_accurev_promote() {
_arguments -s \
'-c[Comment to associate with the transaction]:comment:_accurev_comment' \
'(-t -e)-l[file containing names of elements to be processed]:list file:_accurev_l' \
'(-k -p)-d[select the members of the default group]' \
'(-t -l)-e[specify integer element-ID]:element id:_accurev_element_id' \
'(-d -p)-k[select kept elements]' \
'-K[Keep modified elements before promoting them]' \
'(-d -k)-p[select both modified elements and kept elements]' \
'-g[Fill in gaps during change package promotion]' \
'-I[Add the promoted versions to the change package of the specified Dispatch issue record]:issue number:_accurev_issue_number' \
'-O[Promote even if the element has (overlap) status]' \
'-N[Suppress change package merge required error]' \
'(-l -e)-t[Promote the versions in the specified transaction]:transaction:_accurev_transaction' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_purge] )) ||
_accurev_purge() {
_arguments -s \
'-s[purge changes from a stream]:stream:_accurev_streams' \
'(-e)-l[file containing names of elements to be processed]:list file:_accurev_l' \
'(-l)-e[specify integer element-ID]:element id:_accurev_element_id' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_putconfig] )) ||
_accurev_putconfig() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_reactivate] )) ||
_accurev_reactivate() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_reclaim] )) ||
_accurev_reclaim() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_remove] )) ||
_accurev_remove() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_replica] )) ||
_accurev_replica() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_revert] )) ||
_accurev_revert() {
_arguments -s \
'-t[transaction to reverse]:transaction:_accurev_transaction' \
}
(( $+functions[_accurev_rmmember] )) ||
_accurev_rmmember() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_rmreplica] )) ||
_accurev_rmreplica() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_rmtrig] )) ||
_accurev_rmtrig() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_rmws] )) ||
_accurev_rmws() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_secinfo] )) ||
_accurev_secinfo() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_setacl] )) ||
_accurev_setacl() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_setlocalpasswd] )) ||
_accurev_setlocalpasswd() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_show] )) ||
_accurev_show() {
local curcontext="$curcontext"
if (( ! $+_accurev_show_cmds )); then
typeset -gA _accurev_show_cmds
_accurev_show_cmds=(
streams :streams:
wspaces :wspaces:
depots :depots:
)
fi
if (( CURRENT == 2 )); then
_tags -C show commands && { compadd "$@" -k _accurev_show_cmds || compadd "$@" ${(s.:.)_accurev_show_cmds} }
else
cmd="${${(k)_accurev_show_cmds[(R)*:$words[2]:*]}:-${(k)_accurev_show_cmds[(i):$words[2]:]}}"
if (( $#cmd )); then
curcontext="${curcontext%:*:*}:accurev-show-${cmd}:"
_call_function ret _accurev_show_$cmd || _message 'no more arguments'
else
_message "unknown accurev show command: $words[2]"
fi
return ret
fi
}
(( $+functions[_accurev_show_streams] )) ||
_accurev_show_streams() {
_arguments -s \
'-f-[Output format]:style:_accurev_show_f' \
'-p[perform the operation using this depot]:depot:_accurev_depots' \
'-s[stream to work with]:stream:_accurev_streams' \
'-t[show the streams that existed at the specified time]:time:_accurev_timespec' \
'*:' \
}
(( $+functions[_accurev_show_wspaces] )) ||
_accurev_show_wspaces() {
_arguments -s \
'-f-[Output format]:style:_accurev_show_f' \
'-a[Unkown option]' \
'*:' \
}
(( $+functions[_accurev_show_depots] )) ||
_accurev_show_depots() {
_arguments -s \
'-fx[XML output]' \
'*:' \
}
(( $+functions[_accurev_show_f] )) ||
_accurev_show_f() {
_values 'output format' \
'i[show invisible items]' \
'x[XML output]' \
'v[show license kind in show users]' \
}
(( $+functions[_accurev_depots] )) ||
_accurev_depots() {
_message -e meassges "Not Implemented"
}
(( $+functions[_accurev_streams] )) ||
_accurev_streams() {
_message -e meassges "Not Implemented"
}
(( $+functions[_accurev_timespec] )) ||
_accurev_timespec() {
_message -e meassges "Not Implemented"
}
(( $+functions[_accurev_start] )) ||
_accurev_start() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_stat] )) ||
_accurev_stat() {
_arguments -s \
'(-l)-a[select all elements]' \
'(-s -x)-b[Show elements status in backing stream]' \
'(-x -b -s)-B[ Include elements status in streams in workspaces backing chain]' \
'(-x)-d[select the members of the default group]' \
'(-x)-D[select defunct elements]' \
'-f-[format]:format:_accurev_stat_format' \
'(-x)-i[select stranded elements]' \
'(-x -b -s)-k[select kept elements]' \
'-l[file containing names of elements to be processed]:list file:_accurev_l' \
'(-b -s -x)-m[select modified elements]' \
'(-b -s -x)-M[display missing files]' \
'(-b -s -x)-n[select modified non-member elements]' \
'(-x)-o[select overlapping elements]' \
'(-b -s -x)-O[do not use timestamp optimization]' \
'(-b -s -x)-p[select both modified elements and kept elements]' \
'(-b -s)-R[recurse through specified directorys]' \
'(-b -x)-s[stream]:stream:_accurev_streams' \
'(-a -b -B -d -D -i -k -m -n -o -p -s -X)-x[select files/dirs in workspace that are not under version control]' \
'(-b -s -x)-X[display excluded files]' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_stat_format] )) ||
_accurev_stat_format() {
_values 'Format to use' \
'(r)a[absolute]' \
'(a)r[relative]' \
'(d)f[files only]' \
'(f)d[dirs only]' \
'l[location only]' \
'e[element ID]' \
'k' \
}
(( $+functions[_accurev_synctime] )) ||
_accurev_synctime() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_touch] )) ||
_accurev_touch() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_translist] )) ||
_accurev_translist() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_unarchive] )) ||
_accurev_unarchive() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_undefunct] )) ||
_accurev_undefunct() {
_arguments -s \
'(-e)-l[file containing names of elements to be processed]:list file:_accurev_l' \
'(-l)-e[specify integer element-ID]:element id:_accurev_element_id' \
'*:file:_accurev_elements' \
}
(( $+functions[_accurev_unlock] )) ||
_accurev_unlock() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_unmap] )) ||
_accurev_unmap() {
_call_function ret _accurev_default_action || _message 'unable to find default action'
}
(( $+functions[_accurev_update] )) ||
_accurev_update() {
_arguments -s \
'-i[display information only]' \
'-r[reference tree to update]:tree:_accurev_tree' \
'-t[update up to specific transaction]:transaction:_accurev_transaction' \
}
(( $+functions[_accurev_wip] )) ||
_accurev_wip() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_xml] )) ||
_accurev_xml() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
(( $+functions[_accurev_version_spec] )) ||
_accurev_version_spec() {
_message -e messages "Not implemented"
}
(( $+functions[_accurev_depot] )) ||
_accurev_depot() {
_message -e messages "Not implemented"
}
(( $+functions[_accurev_new_depot_name] )) ||
_accurev_new_depot_name() {
_message -e messages "Not implemented"
}
(( $+functions[_accurev_format] )) ||
_accurev_format() {
_values 'Format to use' \
'd[date]' \
't[transaction number]' \
'u[user name]' \
}
(( $+functions[_accurev_element] )) ||
_accurev_element() {
_message -e messages 'Not finished'
_wanted files expl 'Element to lookup' _path_files
}
(( $+functions[_accurev_comment] )) ||
_accurev_comment() {
_message -e messages "transaction message"
}
(( $+functions[_accurev_element_type] )) ||
_accurev_element_type() {
_values 'element type created' \
'binary[versions cannot be combined with merge]' \
'text[versions can be combined with merge, line terminators are normalized to NLs in the repo]' \
'ptext[perserved test: mergeable, but no line terminator translations]'
}
(( $+functions[_accurev_l] )) ||
_accurev_l() {
_wanted files expl 'File containing files to be processed' _path_files
}
(( $+functions[_accurev_elements] )) ||
_accurev_elements() {
_message -e messages 'Not completely implemented'
_wanted file expl 'Element to operate on' _path_files
}
(( $+functions[_accurev_files_unmaintained] )) ||
_accurev_files_unmaintained() {
_accurev_existing_directories
}
(( $+functions[_accurev_existing_directories] )) ||
_accurev_existing_directories() {
_wanted directories expl directory _path_files
}
## default action
(( $+functions[_accurev_default_action] )) ||
_accurev_default_action() {
_message -e meassges "$(accurev help $words[1])"
_arguments -s \
'*:file:_path_files' \
}
_accurev "$@"
## Local Variables:
## mode: shell-script
## sh-shell: zsh
## End: