summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6332098)
raw | patch | inline | side by side (parent: 6332098)
author | Wincent Colaiuta <win@wincent.com> | |
Mon, 3 Dec 2007 08:09:43 +0000 (09:09 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Dec 2007 09:04:28 +0000 (01:04 -0800) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-add--interactive.perl | patch | blob | history |
index 32fb9ea2bbfab424a1b189753fc818a9c405992a..335c2c6b56875b97ad6cf8f4406218833afc53ef 100755 (executable)
!($prefix =~ /[\s,]/) && # separators
!($prefix =~ /^-/) && # deselection
!($prefix =~ /^\d+/) && # selection
- ($prefix ne '*'); # "all" wildcard
+ ($prefix ne '*') && # "all" wildcard
+ ($prefix ne '?'); # prompt help
}
# given a prefix/remainder tuple return a string with the prefix highlighted
}
chomp $line;
last if $line eq '';
+ if ($line eq '?') {
+ $opts->{SINGLETON} ?
+ singleton_prompt_help_cmd() :
+ prompt_help_cmd();
+ next TOPLOOP;
+ }
for my $choice (split(/[\s,]+/, $line)) {
my $choose = 1;
my ($bottom, $top);
return @return;
}
+sub singleton_prompt_help_cmd {
+ print <<\EOF ;
+Prompt help:
+1 - select a numbered item
+foo - select item based on unique prefix
+ - (empty) select nothing
+EOF
+}
+
+sub prompt_help_cmd {
+ print <<\EOF ;
+Prompt help:
+1 - select a single item
+3-5 - select a range of items
+2-3,6-9 - select multiple ranges
+foo - select item based on unique prefix
+-... - unselect specified items
+* - choose all items
+ - (empty) finish selecting
+EOF
+}
+
sub status_cmd {
list_and_choose({ LIST_ONLY => 1, HEADER => $status_head },
list_modified());