monotone

monotone Commit Details

Date:2010-11-17 16:52:13 (8 years 7 months ago)
Author:Richard Levitte
Branch:net.venge.monotone
Commit:1b315e96fc1f933325d5fb9942aef563a683467c
Parents: d29ec4adcacef7e948e27eacd139ef01157c6531
Message:Rewrite the bash completion package, make it ready for mtn 1.0

Changes:
Acontrib/monotone.bash_completion2 (full)
Acontrib/monotone_gen_bash_completion_table.pl (full)

File differences

contrib/monotone.bash_completion2
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
# -*- shell-script -*-
# bash completion for monotone 1.0
# Author: Richard Levitte <richard@levitte.org>
#
# Based on previous script by Olivier Andrieu <oandrieu@nerim.net>
# with contributions by Matthew A. Nicholson <matt@matt-land.com>
# and Matthew Sackman <matthew@wellquite.org>
# Requirements:
# the bash completion package <http://www.caliban.org/bash/>,
# copy this file in the directory /etc/bash_completion.d
# List information on the stuff to parse (this could really be in a
# separate file that any completion package could load and use).
# These lines were generated with the perl script
# monotone_gen_bash_completion_table.pl
# BEGIN ----------------------------------------------------------------------
declare -a _monotone_options_noarg
_monotone_options_noarg=(
--allow-default-confdir
--allow-workspace
--bookkeep-only
--brief
--builtin-rcfile
--clear-from
--clear-rcfiles
--clear-to
--concise
--context
--corresponding-renames
--diffs
--drop-bad-certs
--dry-run
--external
--files
--force-duplicate-key
--formatted
--full
--graph
--help
--hidden
--ignore-suspend-certs
--ignored
--interactive
--log-certs
--log-revids
--merges
--missing
--move-conflicting-paths
--no-brief
--no-builtin-rcfile
--no-corresponding-renames
--no-default-confdir
--no-diffs
--no-dry-run
--no-files
--no-format-dates
--no-graph
--no-hidden
--no-ignore-suspend-certs
--no-ignored
--no-log-certs
--no-log-revids
--no-merges
--no-move-conflicting-paths
--no-pid-file
--no-recursive
--no-resolve-conflicts
--no-respect-ignore
--no-set-default
--no-show-encloser
--no-standard-rcfiles
--no-unchanged
--no-unknown
--no-update
--no-workspace
--non-interactive
--plain
--quiet
--recursive
--resolve-conflicts
--respect-ignore
--reverse
--revs-only
--set-default
--show-encloser
--standard-rcfiles
--timestamps
--unchanged
--unified
--unknown
--update
--use-default-key
--use-one-changelog
--verbose
--version
--with-header
--without-header
-R
-h
-q
-v
)
declare -a _monotone_options_arg
_monotone_options_arg=(
--author
--authors-file
--automate-stdio-size
--bind
--branch
--branches-file
--confdir
--conflicts-file
--date
--date-format
--db
--depth
--diff-args
--drop-attr
--dump
--exclude
--export-marks
--from
--import-marks
--key
--key-to-push
--keydir
--last
--log
--message
--message-file
--next
--pid-file
--rcfile
--refs
--remote-stdio-host
--resolve-conflicts-file
--revision
--root
--ssh-sign
--ticker
--to
--xargs
-@
-b
-d
-k
-m
-r
)
declare -A _monotone_options_arg_fns
_monotone_options_arg_fns=(
[--authors-file]=_filedir
[--bind]=_monotone_address_port
[--branch]=_monotone_branches [-b]=_monotone_branches
[--branches-file]=_filedir
[--confdir]=_monotone_dir
[--conflicts-file]=_filedir
[--db]=_filedir [-d]=_filedir
[--dump]=_filedir
[--export-marks]=_filedir
[--from]=_monotone_revision
[--import-marks]=_filedir
[--keydir]=_monotone_dir
[--key]=_monotone_key [-k]=_monotone_public_key
[--key-to-push]=_monotone_public_key
[--log]=_filedir
[--message_file]=_filedir
[--pid-file]=_filedir
[--rcfile]=_filedir
[--refs]=_monotone_refs
[--remote-stdio-host]=_monotone_address_port
[--resolve-conflicts-file]=_filedir
[--revision]=_monotone_revision [-r]=_monotone_revision
[--root]=_monotone_dir
[--ssh-sign]=_monotone_ssh_sign
[--ticker]=_monotone_ticker
[--xargs]=_filedir
[-@]=_filedir
)
declare -A _monotone_aliases
_monotone_aliases['mtn au']='mtn automate'
_monotone_aliases['mtn di']='mtn diff'
_monotone_aliases['mtn ls']='mtn list'
_monotone_aliases['mtn list dbs']='mtn list databases'
declare -A _monotone_command_options
declare -A _monotone_command_args
declare -A _monotone_commands
_monotone_commands['mtn']='add annotate approve asciik attr automate bisect cat cert checkout ci cleanup_workspace_list clone co comment commit complete conflicts cvs_import db di diff disapprove drop dropkey explicit_merge fdiff fload fmerge genkey get_roster git_export heads help identify import list local log manpage merge merge_into_dir merge_into_workspace migrate_workspace mkdir mv passphrase pivot_root pluck privkey propagate pubkey pull push rcs_import read refresh_inodeprints register_workspace rename revert rm serve set setup show_conflicts ssh_agent_add ssh_agent_export status suspend sync tag testresult trusted undrop unregister_workspace unset update version'
_monotone_command_options['mtn']='--allow-default-confdir --allow-workspace --builtin-rcfile --clear-rcfiles --confdir --date-format --db --dump --help --ignore-suspend-certs --interactive --key --keydir --log --no-builtin-rcfile --no-default-confdir --no-format-dates --no-ignore-suspend-certs --no-standard-rcfiles --no-workspace --non-interactive --quiet --rcfile --root --ssh-sign --standard-rcfiles --ticker --timestamps --use-default-key --verbose --version --xargs -@ -d -h -k -q -v'
_monotone_command_args['mtn add']='PATH ...'
_monotone_command_options['mtn add']='--no-recursive --no-respect-ignore --no-unknown --recursive --respect-ignore --unknown -R'
_monotone_command_args['mtn annotate']='PATH'
_monotone_command_options['mtn annotate']='--revision --revs-only -r'
_monotone_command_args['mtn approve']='REVISION'
_monotone_command_options['mtn approve']='--branch --no-update --update -b'
_monotone_command_args['mtn asciik']='SELECTOR'
_monotone_commands['mtn attr']='drop get set'
_monotone_command_args['mtn attr drop']='PATH ATTR'
_monotone_command_args['mtn attr get']='PATH ATTR'
_monotone_command_args['mtn attr set']='PATH ATTR VALUE'
_monotone_commands['mtn automate']='ancestors ancestry_difference branches cert certs checkout children common_ancestors content_diff descendents drop_attribute drop_db_variables drop_public_key erase_ancestors file_merge generate_key get_attributes get_base_revision_id get_content_changed get_corresponding_path get_current_revision get_current_revision_id get_db_variables get_extended_manifest_of get_file get_file_of get_file_size get_manifest_of get_option get_public_key get_revision get_workspace_root graph heads identify interface_version inventory keys leaves log lua packet_for_fdata packet_for_fdelta packet_for_rdata packets_for_certs parents pull push put_file put_public_key put_revision read_packets remote remote_stdio roots select set_attribute set_db_variable show_conflicts stdio sync tags toposort update'
_monotone_command_args['mtn automate ancestors']='REV1 REV2 REV3 ...'
_monotone_command_args['mtn automate ancestry_difference']='NEW_REV OLD_REV1 OLD_REV2 ...'
### Missing mtn automate branches
_monotone_command_args['mtn automate cert']='REVISION-ID NAME VALUE'
_monotone_command_args['mtn automate certs']='REV'
_monotone_command_args['mtn automate checkout']='DIRECTORY'
_monotone_command_options['mtn automate checkout']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
_monotone_command_args['mtn automate children']='REV'
_monotone_command_args['mtn automate common_ancestors']='REV1 REV2 REV3 ...'
_monotone_command_args['mtn automate content_diff']='FILE ...'
_monotone_command_options['mtn automate content_diff']='--depth --exclude --reverse --revision --with-header --without-header -r'
_monotone_command_args['mtn automate descendents']='REV1 REV2 REV3 ...'
_monotone_command_args['mtn automate drop_attribute']='PATH KEY'
_monotone_command_args['mtn automate drop_db_variables']='DOMAIN NAME'
_monotone_command_args['mtn automate drop_public_key']='KEY_NAME_OR_HASH'
_monotone_command_args['mtn automate erase_ancestors']='REV1 REV2 REV3 ...'
_monotone_command_args['mtn automate file_merge']='LEFT_REVID LEFT_FILENAME RIGHT_REVID RIGHT_FILENAME'
_monotone_command_args['mtn automate generate_key']='KEY_NAME PASSPHRASE'
_monotone_command_options['mtn automate generate_key']='--force-duplicate-key'
_monotone_command_args['mtn automate get_attributes']='PATH'
### Missing mtn automate get_base_revision_id
_monotone_command_args['mtn automate get_content_changed']='REV FILE'
_monotone_command_args['mtn automate get_corresponding_path']='REV1 FILE REV2'
_monotone_command_args['mtn automate get_current_revision']='PATHS ...'
_monotone_command_options['mtn automate get_current_revision']='--depth --exclude'
### Missing mtn automate get_current_revision_id
_monotone_command_args['mtn automate get_db_variables']='DOMAIN'
_monotone_command_args['mtn automate get_extended_manifest_of']='REVISION'
_monotone_command_args['mtn automate get_file']='FILEID'
_monotone_command_args['mtn automate get_file_of']='FILENAME'
_monotone_command_options['mtn automate get_file_of']='--revision -r'
_monotone_command_args['mtn automate get_file_size']='FILEID'
_monotone_command_args['mtn automate get_manifest_of']='REVID'
_monotone_command_args['mtn automate get_option']='OPTION'
_monotone_command_args['mtn automate get_public_key']='KEY_NAME_OR_HASH'
_monotone_command_args['mtn automate get_revision']='REVID'
### Missing mtn automate get_workspace_root
### Missing mtn automate graph
_monotone_command_args['mtn automate heads']='BRANCH'
_monotone_command_args['mtn automate identify']='PATH'
### Missing mtn automate interface_version
_monotone_command_args['mtn automate inventory']='PATH ...'
_monotone_command_options['mtn automate inventory']='--corresponding-renames --depth --exclude --ignored --no-corresponding-renames --no-ignored --no-unchanged --no-unknown --unchanged --unknown'
### Missing mtn automate keys
### Missing mtn automate leaves
_monotone_command_args['mtn automate log']='PATH ...'
_monotone_command_options['mtn automate log']='--clear-from --clear-to --depth --exclude --from --last --merges --next --no-merges --to'
_monotone_command_args['mtn automate lua']='LUA_FUNCTION ARG1 ARG2 ...'
_monotone_command_args['mtn automate packet_for_fdata']='FILEID'
_monotone_command_args['mtn automate packet_for_fdelta']='OLD_FILE NEW_FILE'
_monotone_command_args['mtn automate packet_for_rdata']='REVID'
_monotone_command_args['mtn automate packets_for_certs']='REVID'
_monotone_command_args['mtn automate parents']='REV'
_monotone_command_args['mtn automate pull']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn automate pull']='--dry-run --exclude --no-dry-run --no-set-default --set-default'
_monotone_command_args['mtn automate push']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn automate push']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
_monotone_command_args['mtn automate put_file']='FILEID CONTENTS'
_monotone_command_args['mtn automate put_public_key']='KEY-PACKET-DATA'
_monotone_command_args['mtn automate put_revision']='REVISION-DATA'
_monotone_command_args['mtn automate read_packets']='PACKET-DATA'
_monotone_command_args['mtn automate remote']='COMMAND ARGS'
_monotone_command_options['mtn automate remote']='--no-set-default --remote-stdio-host --set-default'
_monotone_command_args['mtn automate remote_stdio']='ADDRESS:PORTNUMBER'
_monotone_command_options['mtn automate remote_stdio']='--no-set-default --set-default'
### Missing mtn automate roots
_monotone_command_args['mtn automate select']='SELECTOR'
_monotone_command_args['mtn automate set_attribute']='PATH KEY VALUE'
_monotone_command_args['mtn automate set_db_variable']='DOMAIN NAME VALUE'
_monotone_command_args['mtn automate show_conflicts']='LEFT_REVID RIGHT_REVID'
_monotone_command_options['mtn automate show_conflicts']='--branch --ignore-suspend-certs --no-ignore-suspend-certs -b'
_monotone_command_options['mtn automate stdio']='--automate-stdio-size'
_monotone_command_args['mtn automate sync']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn automate sync']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
_monotone_command_args['mtn automate tags']='BRANCH_PATTERN'
_monotone_command_args['mtn automate toposort']='REV1 REV2 REV3 ...'
_monotone_command_options['mtn automate update']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
_monotone_commands['mtn bisect']='bad good reset skip status update'
_monotone_command_options['mtn bisect bad']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
_monotone_command_options['mtn bisect good']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
### Missing mtn bisect reset
_monotone_command_options['mtn bisect skip']='--move-conflicting-paths --no-move-conflicting-paths --revision -r'
### Missing mtn bisect status
_monotone_command_options['mtn bisect update']='--move-conflicting-paths --no-move-conflicting-paths'
_monotone_command_args['mtn cat']='FILENAME'
_monotone_command_options['mtn cat']='--revision -r'
_monotone_command_args['mtn cert']='SELECTOR CERTNAME CERTVAL'
_monotone_command_args['mtn checkout']='DIRECTORY'
_monotone_command_args['mtn ci']='PATH ...'
### Missing mtn cleanup_workspace_list
_monotone_command_args['mtn clone']='HOST:PORTNUMBER BRANCH DIRECTORY'
_monotone_command_options['mtn clone']='--branch --revision -b -r'
_monotone_command_args['mtn co']='DIRECTORY'
_monotone_command_options['mtn co']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
_monotone_command_args['mtn comment']='REVISION COMMENT'
_monotone_command_args['mtn commit']='PATH ...'
_monotone_command_options['mtn commit']='--author --branch --date --depth --exclude --message --message-file -b -m'
_monotone_command_args['mtn complete']='(revision|file|key) PARTIAL-ID'
_monotone_commands['mtn conflicts']='clean resolve_first resolve_first_left resolve_first_right show_first show_remaining store'
### Missing mtn conflicts clean
_monotone_command_args['mtn conflicts resolve_first']='RESOLUTION'
_monotone_command_options['mtn conflicts resolve_first']='--conflicts-file'
_monotone_command_args['mtn conflicts resolve_first_left']='RESOLUTION'
_monotone_command_options['mtn conflicts resolve_first_left']='--conflicts-file'
_monotone_command_args['mtn conflicts resolve_first_right']='RESOLUTION'
_monotone_command_options['mtn conflicts resolve_first_right']='--conflicts-file'
_monotone_command_options['mtn conflicts show_first']='--conflicts-file'
_monotone_command_options['mtn conflicts show_remaining']='--conflicts-file'
_monotone_command_args['mtn conflicts store']='LEFT_REVID RIGHT_REVID'
_monotone_command_options['mtn conflicts store']='--branch --conflicts-file -b'
_monotone_command_args['mtn cvs_import']='CVSROOT'
_monotone_command_options['mtn cvs_import']='--branch -b'
_monotone_commands['mtn db']='changesetify check dump execute fix_certs info init load migrate regenerate_caches rosterify set_epoch version'
### Missing mtn db changesetify
### Missing mtn db check
### Missing mtn db dump
### Missing mtn db execute
_monotone_command_options['mtn db fix_certs']='--drop-bad-certs'
_monotone_command_options['mtn db info']='--concise --full'
### Missing mtn db init
### Missing mtn db load
### Missing mtn db migrate
### Missing mtn db regenerate_caches
_monotone_command_options['mtn db rosterify']='--drop-attr'
_monotone_command_args['mtn db set_epoch']='BRANCH EPOCH'
### Missing mtn db version
_monotone_command_args['mtn di']='PATH ...'
_monotone_command_args['mtn diff']='PATH ...'
_monotone_command_options['mtn diff']='--context --depth --diff-args --exclude --external --no-show-encloser --reverse --revision --show-encloser --unified --with-header --without-header -r'
_monotone_command_args['mtn disapprove']='PARENT-REVISION CHILD-REVISION'
_monotone_command_options['mtn disapprove']='--author --branch --date --message --message-file --no-update --update -b -m'
_monotone_command_args['mtn drop']='PATH ...'
_monotone_command_args['mtn dropkey']='KEY_NAME_OR_HASH'
_monotone_command_args['mtn explicit_merge']='LEFT-REVISION RIGHT-REVISION DEST-BRANCH'
_monotone_command_options['mtn explicit_merge']='--author --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -m'
_monotone_command_args['mtn fdiff']='SRCNAME DESTNAME SRCID DESTID'
_monotone_command_options['mtn fdiff']='--context --diff-args --external --no-show-encloser --reverse --show-encloser --unified --with-header --without-header'
### Missing mtn fload
_monotone_command_args['mtn fmerge']='<parent> <left> <right>'
_monotone_command_args['mtn genkey']='KEY_NAME'
_monotone_command_options['mtn genkey']='--force-duplicate-key'
_monotone_command_args['mtn get_roster']='REVID'
_monotone_command_options['mtn git_export']='--authors-file --branches-file --export-marks --import-marks --log-certs --log-revids --no-log-certs --no-log-revids --refs --use-one-changelog'
_monotone_command_options['mtn heads']='--branch -b'
_monotone_command_args['mtn help']='command ARGS ...'
_monotone_command_options['mtn help']='--hidden --no-hidden'
_monotone_command_args['mtn identify']='PATH'
_monotone_command_args['mtn import']='DIRECTORY'
_monotone_command_options['mtn import']='--author --branch --date --dry-run --exclude --message --message-file --no-dry-run --no-respect-ignore --respect-ignore --revision -b -m -r'
_monotone_commands['mtn list']='branches certs changed databases dbs duplicates epochs ignored keys known missing tags unknown vars'
_monotone_command_args['mtn list branches']='PATTERN'
_monotone_command_options['mtn list branches']='--exclude'
_monotone_command_args['mtn list certs']='ID'
_monotone_command_options['mtn list changed']='--depth --exclude'
### Missing mtn list databases
### Missing mtn list dbs
_monotone_command_options['mtn list duplicates']='--revision -r'
_monotone_command_args['mtn list epochs']='BRANCH ...'
### Missing mtn list ignored
_monotone_command_args['mtn list keys']='PATTERN'
_monotone_command_options['mtn list known']='--depth --exclude'
_monotone_command_options['mtn list missing']='--depth --exclude'
_monotone_command_args['mtn list tags']='PATTERN'
_monotone_command_options['mtn list tags']='--exclude'
_monotone_command_options['mtn list unknown']='--depth --exclude'
_monotone_command_args['mtn list vars']='DOMAIN'
_monotone_commands['mtn local']='kill_certs kill_revision'
_monotone_command_args['mtn local kill_certs']='SELECTOR CERTNAME CERTVAL'
_monotone_command_options['mtn local kill_certs']='--revision -r'
_monotone_command_args['mtn local kill_revision']='ID'
_monotone_command_args['mtn log']='PATH ...'
_monotone_command_options['mtn log']='--brief --clear-from --clear-to --depth --diffs --exclude --files --from --graph --last --merges --next --no-brief --no-diffs --no-files --no-graph --no-merges --revision --to -r'
_monotone_command_options['mtn manpage']='--formatted --hidden --no-hidden --plain'
_monotone_command_options['mtn merge']='--author --branch --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -b -m'
_monotone_command_args['mtn merge_into_dir']='SOURCE-BRANCH DEST-BRANCH DIR'
_monotone_command_options['mtn merge_into_dir']='--author --date --message --message-file --no-resolve-conflicts --no-update --resolve-conflicts --resolve-conflicts-file --update -m'
_monotone_command_args['mtn merge_into_workspace']='OTHER-REVISION'
_monotone_command_options['mtn merge_into_workspace']='--move-conflicting-paths --no-move-conflicting-paths'
_monotone_command_args['mtn migrate_workspace']='DIRECTORY'
_monotone_command_args['mtn mkdir']='DIRECTORY ...'
_monotone_command_options['mtn mkdir']='--no-respect-ignore --respect-ignore'
_monotone_command_args['mtn mv']='SRC1 SRC2 ... DEST_DIR'
_monotone_command_args['mtn passphrase']='KEY_NAME_OR_HASH'
_monotone_command_args['mtn pivot_root']='NEW_ROOT PUT_OLD'
_monotone_command_options['mtn pivot_root']='--bookkeep-only --move-conflicting-paths --no-move-conflicting-paths'
_monotone_command_args['mtn pluck']='-r FROM -r TO PATH ...'
_monotone_command_options['mtn pluck']='--depth --exclude --move-conflicting-paths --no-move-conflicting-paths --revision -r'
_monotone_command_args['mtn privkey']='ID'
_monotone_command_args['mtn propagate']='SOURCE-BRANCH DEST-BRANCH'
_monotone_command_options['mtn propagate']='--author --date --message --message-file --no-resolve-conflicts --resolve-conflicts --resolve-conflicts-file -m'
_monotone_command_args['mtn pubkey']='KEY_NAME_OR_HASH'
_monotone_command_args['mtn pull']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn pull']='--dry-run --exclude --no-dry-run --no-set-default --no-update --set-default --update'
_monotone_command_args['mtn push']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn push']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --set-default'
_monotone_command_args['mtn rcs_import']='RCSFILE ...'
_monotone_command_options['mtn rcs_import']='--branch -b'
_monotone_command_args['mtn read']='FILE1 FILE2 ...'
### Missing mtn refresh_inodeprints
_monotone_command_args['mtn register_workspace']='WORKSPACE_PATH'
_monotone_command_args['mtn rename']='SRC1 SRC2 ... DEST_DIR'
_monotone_command_options['mtn rename']='--bookkeep-only'
_monotone_command_args['mtn revert']='PATH ...'
_monotone_command_options['mtn revert']='--depth --exclude --missing'
_monotone_command_args['mtn rm']='PATH ...'
_monotone_command_options['mtn rm']='--bookkeep-only --missing --no-recursive --recursive -R'
_monotone_command_options['mtn serve']='--bind --no-pid-file --pid-file'
_monotone_command_args['mtn set']='DOMAIN NAME VALUE'
_monotone_command_args['mtn setup']='DIRECTORY'
_monotone_command_options['mtn setup']='--branch -b'
_monotone_command_args['mtn show_conflicts']='REV REV'
### Missing mtn ssh_agent_add
_monotone_command_args['mtn ssh_agent_export']='FILENAME'
_monotone_command_args['mtn status']='PATH ...'
_monotone_command_options['mtn status']='--depth --exclude'
_monotone_command_args['mtn suspend']='REVISION'
_monotone_command_options['mtn suspend']='--branch --no-update --update -b'
_monotone_command_args['mtn sync']='ADDRESS:PORTNUMBER PATTERN ...'
_monotone_command_options['mtn sync']='--dry-run --exclude --key-to-push --no-dry-run --no-set-default --no-update --set-default --update'
_monotone_command_args['mtn tag']='REVISION TAGNAME'
_monotone_command_args['mtn testresult']='ID (pass|fail|true|false|yes|no|1|0)'
_monotone_command_args['mtn trusted']='REVISION NAME VALUE SIGNER1 SIGNER2 ...'
_monotone_command_args['mtn undrop']='PATH ...'
_monotone_command_args['mtn unregister_workspace']='WORKSPACE_PATH'
_monotone_command_args['mtn unset']='DOMAIN NAME'
_monotone_command_options['mtn update']='--branch --move-conflicting-paths --no-move-conflicting-paths --revision -b -r'
_monotone_command_options['mtn version']='--concise --full'
# END ------------------------------------------------------------------------
_monotone_previous_RETURN=`trap -p RETURN`
_monotone_previous_SIGHUP=`trap -p SIGHUP`
_monotone_previous_SIGINT=`trap -p SIGINT`
_monotone_previous_SIGPIPE=`trap -p SIGPIPE`
_monotone_previous_SIGTERM=`trap -p SIGTERM`
if shopt -q extglob; then :; else
shopt -s extglob
trap "shopt -u extglob; ${_monotone_previous_RETURN:-trap - RETURN}; ${_monotone_previous_SIGHUP:-trap - SIGHUP}; ${_monotone_previous_SIGINT:-trap - SIGINT}; ${_monotone_previous_SIGPIPE:-trap - SIGPIPE}; ${_monotone_previous_SIGTERM:-trap - SIGTERM}" RETURN SIGHUP SIGINT SIGPIPE SIGTERM
fi
# Call monotone to complete IDs
_monotone_complete() {
if (( "${#cur}" >=2 )) ; then
COMPREPLY=( "${COMPREPLY[@]}" $(mtn $mono_db complete $1 $cur 2> /dev/null) )
fi
}
_monotone_revisions() {
_monotone_complete revision
}
_monotone_manifests() {
_monotone_complete manifest ??????
}
_monotone_manifest_files() {
_monotone_complete file
}
_monotone_dirs() {
_filedir -d
}
_monotone_files() {
_filedir
}
# Call monotone to complete key ids (private or public)
_monotone_keys() {
local range
if [ "$1" == "privkey" ]; then
range='/\[private/,$'
else
range='1,/\[private/'
fi
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$(mtn $mono_db list keys 2> /dev/null |\
sed -n ${range}'{/^[0-9a-f]/s/[0-9a-f]* //p}')" -- ${cur#*=} ) )
}
_monotone_branches() {
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$(mtn $mono_db list branches 2> /dev/null)" -- ${cur#*=} ) )
}
_monotone_tags() {
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$(mtn $mono_db list tags 2> /dev/null | awk '{print $1}')" -- ${cur#*=} ) )
}
_monotone_public_key() {
_monotone_keys pubkey
}
_monotone_refs() {
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W 'revs roots leaves' -- $cur) )
}
_monotone_ssh_sign() {
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W 'yes no only check' -- $cur) )
}
_monotone_ticker() {
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W 'count dot none' -- $cur) )
}
_monotone_address_port() {
if [[ "$cur" == *:* ]]; then
# remove backslash escape from the first colon
cur=${cur/\\:/:}
local userhost=${cur%%?(\\):*}
local port=${cur#*:}
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W '4691' -- $port) )
else
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -A hostname -- $cur) )
fi
}
_monotone_command_words() {
cmd_prev_line=
cmd_line=
cmd_words=()
cmd_cword=-1
arg_words=()
arg_cword=-1
cmd_cur=
cmd_prev=
local w pw i cmdi argi
w=
cmdi=0
argi=0
for i in ${!words[@]}; do
pw=$w
w=${words[$i]}
if [[ "$w" == --*=* || "$w" == -* ]]; then
:
elif [[ "$pw" != -* \
|| " ${_monotone_options_noarg[*]} " == *\ $pw\ * ]]; then
if [[ -z "$cmd_line" \
|| -n "${_monotone_commands[$cmd_line]}" ]]; then
if [ $i -le $cword ]; then
cmd_cword=$cmdi
cmd_prev=$cmd_cur
cmd_cur=$w
cmd_prev_line=$cmd_line
if [ -n "$cmd_line" ]; then
cmd_line="$cmd_line "
fi
cmd_line="$cmd_line$w"
if [ -n "${_monotone_aliases[$cmd_line]}" ]; then
cmd_line=${_monotone_aliases[$cmd_line]}
fi
fi
cmd_words[$cmdi]=$w
(( cmdi += 1 ))
else
if [ $i -le $cword ]; then
cmd_cword=-1
arg_cword=$argi
arg_prev=$arg_cur
arg_cur=$w
fi
arg_words[$argi]=$w
(( argi += 1 ))
fi
fi
done
}
_monotone() {
local cur prev words cword mono_db
local cmd_words cmd_cword cmd_cur cmd_prev cmd_line cmd_prev_line
local arg_words arg_cword arg_cur arg_prev
local i cmdi argi
local x
if [[ $- == *v* ]]; then
original_v_value="-v"
else
original_v_value="+v"
fi
#set -v
if [[ $- == *x* ]]; then
original_x_value="-x"
else
original_x_value="+x"
fi
#set -x
COMPREPLY=()
_get_comp_words_by_ref -n : cur prev words cword
_split_longopt
_monotone_command_words
for w in ${words[@]} ; do
if [[ "$w" == --db=* ]] ; then
mono_db="$w" ; break
fi
done
if [ -z "$mono_db" ] ; then
for i in ${!words[@]} ; do
[ $i -eq 0 ] && continue
x="${words[$i-1]}"
if [ "$x" == --db -o "$x" == -d ] ; then
mono_db="--db=${words[$i]}" ; break
fi
done
fi
case $cur in
*/a:!(*/[[:alpha:]]:*) | *=a:!(*/[[:alpha:]]:*) | a:!(*/[[:alpha:]]:*) )
cur="${cur##*a:}"
_monotone_public_keys
;;
*/b:!(*/[[:alpha:]]:*) | *=b:!(*/[[:alpha:]]:*) | b:!(*/[[:alpha:]]:*) )
cur="${cur##*b:}"
_monotone_branches
;;
*/h:!(*/[[:alpha:]]:*) | *=h:!(*/[[:alpha:]]:*) | h:!(*/[[:alpha:]]:*) )
cur="${cur##*h:}"
_monotone_branches
;;
*/i:!(*/[[:alpha:]]:*) | *=i:!(*/[[:alpha:]]:*) | i:!(*/[[:alpha:]]:*) )
cur="${cur##*i:}"
_monotone_revisions
;;
*/t:!(*/[[:alpha:]]:*) | *=t:!(*/[[:alpha:]]:*) | t:!(*/[[:alpha:]]:*) )
cur="${cur##*t:}"
_monotone_tags
;;
-* )
if [ $cword -gt 0 ]; then
x=(
${_monotone_command_options["mtn"]}
${_monotone_command_options[$cmd_line]}
)
fi
COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "${x[*]}" -- $cur) )
;;
* )
if [[ "$prev" == -* \
&& " ${_monotone_options_arg[*]} " == *\ $prev\ * ]]; then
if [ -n "${_monotone_options_arg_fns[$prev]}" ]; then
${_monotone_options_arg_fns[$prev]}
fi
else
COMPREPLY=(
"${COMPREPLY[@]}"
$(compgen -W "${_monotone_command_options["mtn"]}
${_monotone_command_options[$cmd_prev_line]}" -- $cur)
)
if [ $cmd_cword -ge 0 ]; then
if [ -n "${_monotone_commands[$cmd_prev_line]}" ]; then
COMPREPLY=(
"${COMPREPLY[@]}"
$(compgen -W \
"${_monotone_commands[$cmd_prev_line]}" \
-- $cur)
)
fi
elif [ $arg_cword -ge 0 ]; then
local args=( ${_monotone_command_args[$cmd_line]} )
local argtype=${args[$arg_cword]}
if [ -z "$argtype" -a "${args[${#args[*]}-1]}" = "..." ]; then
argtype=${args[${#args[*]}-2]}
fi
case $argtype in
PATH | *FILENAME )
_filedir
;;
REV* | NEW_REV* | OLD_REV* | *REVID | FROM | TO )
_monotone_revisions
;;
DIR* | *ROOT )
_filedir -d
;;
KEY* )
_monotone_public_keys
;;
BRANCH* )
_monotone_branches
;;
ADDR*:PORT* | HOST*:PORT* )
_monotone_address_port
;;
RESOLUTION )
# To be implemented, this one is complex
;;
\(*\) )
COMPREPLY=(
"${COMPREPLY[@]}"
$(compgen -W "`echo "$argtype" | sed -e 's/[()]//g' -e 's/|/ /g'`" -- $cur) )
;;
esac
fi
fi
esac
set $original_v_value
unset original_v_value
set $original_x_value
unset original_x_value
return 0
}
complete -F _monotone -o filenames mtn
contrib/monotone_gen_bash_completion_table.pl
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
#! /usr/bin/perl
use warnings;
use strict;
open MANPAGE,"mtn manpage|" || die "Couldn't start 'mtn manpage': $!\n";
my $current_command = "mtn";
my %options_noarg = ();
my %options_arg = ();
my %command_options = ();
my %command_args = ();
my %commands = ( $current_command => {} );
while (<MANPAGE>) {
chomp;
next if ! m|^\.IP\s|;
if (m|^\.IP "(--[^"]*)"|) {
my $opts = $1;
$opts =~ s|\[\s*(-[a-zA-Z\@])\s*\](\s*<arg>\s*)|$2/ $1$2|g;
$opts =~ s|\[\s*(-[a-zA-Z\@])\s*\]|/ $1 |g;
foreach (split(m|\s*/\s*|, $opts)) {
# print STDERR "DEBUG[$current_command]: opt = $_\n";
my $current_option;
if (m|^\s*(-[-a-zA-Z\@]*)\s+\<arg\>\s*$|) {
$current_option = $1;
$options_arg{$current_option} = 1;
} elsif (m|^\s*(-[-a-zA-Z\@]*)\s*$|) {
$current_option = $1;
$options_noarg{$current_option} = 1;
}
$command_options{$current_command} = []
if (!defined $command_options{$current_command});
push @{$command_options{$current_command}}, $current_option;
}
} elsif (m|^\.IP "\\fB(.*)\s\\fP ([^"]*)"|) {
$current_command = "mtn $1";
$commands{$current_command} = {};
my $current_command_args = $2;
$current_command_args =~ s|[\[\]]||g;
$current_command_args =~ s|\.\.\.\s*$| \.\.\.|;
$command_args{$current_command} =
[ split(m|\s+|,$current_command_args) ];
my $parent_command = "";
for my $commandlet (split(m|\s+|,$current_command)) {
print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
if ($parent_command eq "") {
$parent_command = $commandlet;
} else {
$commands{$parent_command} = {}
if !defined $commands{$parent_command};
$commands{$parent_command}->{$commandlet} = 1;
$parent_command .= " " . $commandlet;
}
}
} elsif (m|^\.IP "\\fB(.*)\s\\fP"|) {
$current_command = "mtn $1";
$commands{$current_command} = {};
my $parent_command = "";
for my $commandlet (split(m|\s+|,$current_command)) {
print STDERR "DEBUG[$current_command]: parent command = $parent_command\n";
print STDERR "DEBUG[$current_command]: commandlet = $commandlet\n";
if ($parent_command eq "") {
$parent_command = $commandlet;
} else {
$commands{$parent_command} = {}
if !defined $commands{$parent_command};
$commands{$parent_command}->{$commandlet} = 1;
$parent_command .= " " . $commandlet;
}
}
}
}
print STDERR "DEBUG: command keys: \n ",join("\n ", sort keys %commands),"\n";
print "declare -a _monotone_options_noarg\n";
print "_monotone_options_noarg=(\n "
,join("\n ", sort keys %options_noarg),"\n)\n";
print "declare -a _monotone_options_arg\n";
print "_monotone_options_arg=(\n "
,join("\n ", sort keys %options_arg),"\n)\n";
print "declare -A _monotone_options_arg_fns\n";
print "_monotone_options_arg_fns=(\n";
print " [--authors-file]=_filedir\n";
print " [--bind]=_monotone_address_port\n";
print " [--branch]=_monotone_branches [-b]=_monotone_branches\n";
print " [--branches-file]=_filedir\n";
print " [--confdir]=_monotone_dir\n";
print " [--conflicts-file]=_filedir\n";
print " [--db]=_filedir [-d]=_filedir\n";
print " [--dump]=_filedir\n";
print " [--export-marks]=_filedir\n";
print " [--from]=_monotone_revision\n";
print " [--import-marks]=_filedir\n";
print " [--keydir]=_monotone_dir\n";
print " [--key]=_monotone_key [-k]=_monotone_public_key\n";
print " [--key-to-push]=_monotone_public_key\n";
print " [--log]=_filedir\n";
print " [--message_file]=_filedir\n";
print " [--pid-file]=_filedir\n";
print " [--rcfile]=_filedir\n";
print " [--refs]=_monotone_refs\n";
print " [--remote-stdio-host]=_monotone_address_port\n";
print " [--resolve-conflicts-file]=_filedir\n";
print " [--revision]=_monotone_revision [-r]=_monotone_revision\n";
print " [--root]=_monotone_dir\n";
print " [--ssh-sign]=_monotone_ssh_sign\n";
print " [--ticker]=_monotone_ticker\n";
print " [--xargs]=_filedir\n";
print " [-@]=_filedir\n";
print ")\n";
print "declare -A _monotone_aliases\n";
print "_monotone_aliases['mtn au']='mtn automate'\n";
print "_monotone_aliases['mtn di']='mtn diff'\n";
print "_monotone_aliases['mtn ls']='mtn list'\n";
print "_monotone_aliases['mtn list dbs']='mtn list databases'\n";
print "declare -A _monotone_command_options\n";
print "declare -A _monotone_command_args\n";
print "declare -A _monotone_commands\n";
foreach my $key (sort keys %commands) {
print STDERR "DEBUG: key = $key\n";
print "_monotone_commands['$key']='"
,join(" ",sort keys %{$commands{$key}})
,"'\n" if defined %{$commands{$key}};
print "_monotone_command_args['$key']='"
,join(" ",@{$command_args{$key}})
,"'\n" if defined $command_args{$key};
print "_monotone_command_options['$key']='"
,join(" ",sort @{$command_options{$key}}),"'\n"
if defined @{$command_options{$key}};
print "### Missing $key\n"
if (!defined %{$commands{$key}} &&
!defined $command_args{$key} &&
!defined @{$command_options{$key}});
}

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status