Skip to content

Commit 33ed7a5

Browse files
committed
_repo: add repo help dump to track new features
With a dump of the actual repo I had when initially writing _repo I should be able to track new options by regenerating the dump every once in a while.
1 parent b673a08 commit 33ed7a5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Functions/Completion/_repo

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
# http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
77
# TODO: list programs, function and styles used
88

9+
# Note: to look for changes in repo's help, one can do this in a repo project:
10+
# $ __repo_dump_help > $ZUKODIR/data/repo-help-dump
11+
# $ cd $ZUKODIR
12+
# $ bzip2 -f data/repo-help-dump
13+
# $ git diff data/repo-help-dump.bz2
14+
#
15+
# for git diff to work on the bz2, you may have to do:
16+
# 1. mkdir -p ${XDG_CONFIG_HOME:-~/.config}/git
17+
# 2. echo '*.bz2 diff=bz2' >> ${XDG_CONFIG_HOME:-~/.config}/git/attributes
18+
# 3. git config --global diff.bz2.binary true
19+
# 4. git config --global diff.bz2.textconv bzcat
920
# TODO: review _arguments to see if -C is really needed everywhere it is used, I
1021
# may have overused it
1122

@@ -635,6 +646,27 @@ _repo() {
635646
return 0
636647
}
637648

649+
(( $+functions[__repo_dump_help] )) ||
650+
__repo_dump_help () {
651+
date --iso-8601
652+
echo
653+
repo version
654+
echo
655+
echo repo help --all
656+
echo "==============="
657+
echo
658+
repo help --all
659+
echo
660+
661+
repo help --all | grep "^ " | while read command descr; do
662+
echo
663+
echo
664+
echo $command
665+
print ${(l:${#command}::=:)}
666+
repo help $command
667+
done
668+
}
669+
638670
_repo "$@"
639671

640672
# Local Variables:

data/repo-help-dump.bz2

13 KB
Binary file not shown.

0 commit comments

Comments
 (0)