##// END OF EJS Templates
zsh completion: add new options for existing commands...
Nikolaj Sjujskij -
r17401:a826b1d7 default
parent child Browse files
Show More
@@ -508,6 +508,7 b' typeset -A _hg_cmd_globals'
508 _hg_cmd_bisect() {
508 _hg_cmd_bisect() {
509 _arguments -s -w : $_hg_global_opts \
509 _arguments -s -w : $_hg_global_opts \
510 '(-)'{-r,--reset}'[reset bisect state]' \
510 '(-)'{-r,--reset}'[reset bisect state]' \
511 '(--extend -e)'{-e,--extend}'[extend the bisect range]' \
511 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \
512 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \
512 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \
513 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \
513 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \
514 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \
@@ -518,6 +519,7 b' typeset -A _hg_cmd_globals'
518 _hg_cmd_bookmarks() {
519 _hg_cmd_bookmarks() {
519 _arguments -s -w : $_hg_global_opts \
520 _arguments -s -w : $_hg_global_opts \
520 '(--force -f)'{-f,--force}'[force]' \
521 '(--force -f)'{-f,--force}'[force]' \
522 '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \
521 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \
523 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \
522 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
524 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
523 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
525 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
@@ -532,13 +534,17 b' typeset -A _hg_cmd_globals'
532
534
533 _hg_cmd_branches() {
535 _hg_cmd_branches() {
534 _arguments -s -w : $_hg_global_opts \
536 _arguments -s -w : $_hg_global_opts \
535 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]'
537 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' \
538 '(--closed -c)'{-c,--closed}'[show normal and closed branches]'
536 }
539 }
537
540
538 _hg_cmd_bundle() {
541 _hg_cmd_bundle() {
539 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
542 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
540 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
543 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
541 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \
544 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \
545 '(--branch -b)'{-b+,--branch}'[a specific branch to bundle]' \
546 '(--rev -r)'{-r+,--rev}'[changeset(s) to bundle]:' \
547 '--all[bundle all changesets in the repository]' \
542 ':output file:_files' \
548 ':output file:_files' \
543 ':destination repository:_files -/'
549 ':destination repository:_files -/'
544 }
550 }
@@ -547,14 +553,15 b' typeset -A _hg_cmd_globals'
547 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
553 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
548 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
554 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
549 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
555 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
556 '--decode[apply any matching decode filter]' \
550 '*:file:_hg_files'
557 '*:file:_hg_files'
551 }
558 }
552
559
553 _hg_cmd_clone() {
560 _hg_cmd_clone() {
554 _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
561 _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
555 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
556 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
562 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
557 '--uncompressed[use uncompressed transfer (fast over LAN)]' \
563 '(--updaterev -u)'{-u+,--updaterev}'[revision, tag or branch to check out]' \
564 '(--branch -b)'{-b+,--branch}'[clone only the specified branch]' \
558 ':source repository:_hg_remote' \
565 ':source repository:_hg_remote' \
559 ':destination:_hg_clone_dest'
566 ':destination:_hg_clone_dest'
560 }
567 }
@@ -567,6 +574,7 b' typeset -A _hg_cmd_globals'
567 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
574 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
568 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
575 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
569 '--amend[amend the parent of the working dir]' \
576 '--amend[amend the parent of the working dir]' \
577 '--close-branch[mark a branch as closed]' \
570 '*:file:_hg_files'
578 '*:file:_hg_files'
571 }
579 }
572
580
@@ -583,6 +591,11 b' typeset -A _hg_cmd_globals'
583 $_hg_pat_opts $_hg_subrepos_opts \
591 $_hg_pat_opts $_hg_subrepos_opts \
584 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
592 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
585 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
593 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
594 '(--change -c)'{-c,--change}'[change made by revision]' \
595 '(--text -a)'{-a,--text}'[treat all files as text]' \
596 '--reverse[produce a diff that undoes the changes]' \
597 '(--unified -U)'{-U,--unified}'[number of lines of context to show]' \
598 '--stat[output diffstat-style summary of changes]' \
586 '*:file:->diff_files'
599 '*:file:->diff_files'
587
600
588 if [[ $state == 'diff_files' ]]
601 if [[ $state == 'diff_files' ]]
@@ -600,6 +613,7 b' typeset -A _hg_cmd_globals'
600 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
613 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
601 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
614 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
602 '--switch-parent[diff against the second parent]' \
615 '--switch-parent[diff against the second parent]' \
616 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
603 '*:revision:_hg_labels'
617 '*:revision:_hg_labels'
604 }
618 }
605
619
@@ -627,17 +641,23 b' typeset -A _hg_cmd_globals'
627 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
641 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
628 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
642 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
629 '(--user -u)'{-u,--user}'[print user who committed change]' \
643 '(--user -u)'{-u,--user}'[print user who committed change]' \
644 '(--date -d)'{-d,--date}'[print date of a changeset]' \
630 '1:search pattern:' \
645 '1:search pattern:' \
631 '*:files:_hg_files'
646 '*:files:_hg_files'
632 }
647 }
633
648
634 _hg_cmd_heads() {
649 _hg_cmd_heads() {
635 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
650 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
651 '(--topo -t)'{-t,--topo}'[show topological heads only]' \
652 '(--closed -c)'{-c,--closed}'[show normal and closed branch heads]' \
636 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels'
653 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels'
637 }
654 }
638
655
639 _hg_cmd_help() {
656 _hg_cmd_help() {
640 _arguments -s -w : $_hg_global_opts \
657 _arguments -s -w : $_hg_global_opts \
658 '(--extension -e)'{-e,--extension}'[show only help for extensions]' \
659 '(--command -c)'{-c,--command}'[show only help for commands]' \
660 '(--keyword -k)'{-k+,--keyword}'[show topics matching keyword]' \
641 '*:mercurial help topic:_hg_help_topics'
661 '*:mercurial help topic:_hg_help_topics'
642 }
662 }
643
663
@@ -647,6 +667,7 b' typeset -A _hg_cmd_globals'
647 '(--num -n)'{-n+,--num}'[show local revision number]' \
667 '(--num -n)'{-n+,--num}'[show local revision number]' \
648 '(--id -i)'{-i+,--id}'[show global revision id]' \
668 '(--id -i)'{-i+,--id}'[show global revision id]' \
649 '(--branch -b)'{-b+,--branch}'[show branch]' \
669 '(--branch -b)'{-b+,--branch}'[show branch]' \
670 '(--bookmark -B)'{-B+,--bookmark}'[show bookmarks]' \
650 '(--tags -t)'{-t+,--tags}'[show tags]'
671 '(--tags -t)'{-t+,--tags}'[show tags]'
651 }
672 }
652
673
@@ -655,6 +676,12 b' typeset -A _hg_cmd_globals'
655 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
676 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
656 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
677 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
657 '--bypass[apply patch without touching the working directory]' \
678 '--bypass[apply patch without touching the working directory]' \
679 '--no-commit[do not commit, just update the working directory]' \
680 '--exact[apply patch to the nodes from which it was generated]' \
681 '--import-branch[use any branch information in patch (implied by --exact)]' \
682 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
683 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
684 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
658 '*:patch:_files'
685 '*:patch:_files'
659 }
686 }
660
687
@@ -690,13 +717,17 b' typeset -A _hg_cmd_globals'
690 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
717 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
691 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
718 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
692 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
719 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
720 '(--graph -G)'{-G+,--graph}'[show the revision DAG]' \
693 '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
721 '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
722 '(--user -u)'{-u+,--user}'[revisions committed by user]:user:' \
723 '(--date -d)'{-d+,--date}'[show revisions matching date spec]:date:' \
694 '*:files:_hg_files'
724 '*:files:_hg_files'
695 }
725 }
696
726
697 _hg_cmd_manifest() {
727 _hg_cmd_manifest() {
698 _arguments -s -w : $_hg_global_opts \
728 _arguments -s -w : $_hg_global_opts \
699 '--all[list files from all revisions]' \
729 '--all[list files from all revisions]' \
730 '(--rev -r)'{-r+,--rev}'[revision to display]:revision:_hg_labels' \
700 ':revision:_hg_labels'
731 ':revision:_hg_labels'
701 }
732 }
702
733
@@ -739,7 +770,7 b' typeset -A _hg_cmd_globals'
739 }
770 }
740
771
741 _hg_cmd_pull() {
772 _hg_cmd_pull() {
742 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
773 _arguments -s -w : $_hg_global_opts $_hg_branch_bmark_opts $_hg_remote_opts \
743 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
774 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
744 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
775 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
745 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
776 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
@@ -747,9 +778,10 b' typeset -A _hg_cmd_globals'
747 }
778 }
748
779
749 _hg_cmd_push() {
780 _hg_cmd_push() {
750 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
781 _arguments -s -w : $_hg_global_opts $_hg_branch_bmark_opts $_hg_remote_opts \
751 '(--force -f)'{-f,--force}'[force push]' \
782 '(--force -f)'{-f,--force}'[force push]' \
752 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
783 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
784 '--new-branch[allow pushing a new branch]' \
753 ':destination:_hg_remote'
785 ':destination:_hg_remote'
754 }
786 }
755
787
@@ -772,6 +804,8 b' typeset -A _hg_cmd_globals'
772 typeset -A opt_args
804 typeset -A opt_args
773
805
774 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
806 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
807 '(--all -a)'{-a,--all}'[select all unresolved files]' \
808 '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \
775 '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
809 '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
776 '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
810 '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
777 '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
811 '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
@@ -792,6 +826,7 b' typeset -A _hg_cmd_globals'
792 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
826 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
793 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
827 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
794 '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
828 '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
829 '(--date -d)'{-d+,--date}'[tipmost revision matching date]:date code:' \
795 '*:file:->diff_files'
830 '*:file:->diff_files'
796
831
797 if [[ $state == 'diff_files' ]]
832 if [[ $state == 'diff_files' ]]
@@ -819,10 +854,15 b' typeset -A _hg_cmd_globals'
819 '(--daemon -d)'{-d,--daemon}'[run server in background]' \
854 '(--daemon -d)'{-d,--daemon}'[run server in background]' \
820 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
855 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
821 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
856 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
857 '--prefix[prefix path to serve from]:directory:_files' \
822 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
858 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
859 '--web-conf[name of the hgweb config file]:webconf_file:_files' \
860 '--pid-file[name of file to write process ID to]:pid_file:_files' \
861 '--cmdserver[cmdserver mode]:mode:' \
823 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
862 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
824 '--style[web template style]:style' \
863 '--style[web template style]:style' \
825 '--stdio[for remote clients]' \
864 '--stdio[for remote clients]' \
865 '--certificate[certificate file]:cert_file:_files' \
826 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
866 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
827 }
867 }
828
868
@@ -846,6 +886,7 b' typeset -A _hg_cmd_globals'
846 '(--copies -C)'{-C,--copies}'[show source of copied files]' \
886 '(--copies -C)'{-C,--copies}'[show source of copied files]' \
847 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
887 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
848 '--rev[show difference from revision]:revision:_hg_labels' \
888 '--rev[show difference from revision]:revision:_hg_labels' \
889 '--change[list the changed files of a revision]:revision:_hg_labels' \
849 '*:files:_files'
890 '*:files:_files'
850 }
891 }
851
892
@@ -861,6 +902,9 b' typeset -A _hg_cmd_globals'
861 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
902 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
862 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
903 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
863 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
904 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
905 '(--force -f)'{-f,--force}'[force tag]' \
906 '--remove[remove a tag]' \
907 '(--edit -e)'{-e,--edit}'[edit commit message]' \
864 ':tag name:'
908 ':tag name:'
865 }
909 }
866
910
@@ -879,6 +923,8 b' typeset -A _hg_cmd_globals'
879 _arguments -s -w : $_hg_global_opts \
923 _arguments -s -w : $_hg_global_opts \
880 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
924 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
881 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
925 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
926 '(--check -c)'{-c,--check}'[update across branches if no uncommitted changes]' \
927 '(--date -d)'{-d+,--date}'[tipmost revision matching date]' \
882 ':revision:_hg_labels'
928 ':revision:_hg_labels'
883 }
929 }
884
930
General Comments 0
You need to be logged in to leave comments. Login now