linux@horizon.com, Sun, Feb 19, 2006 12:26:27 +0100: > >+ for (i = 1 ; i < argc; i++) > >+ if ( !strcmp(argv[i], "--help") ) > >+ usage(rev_list_usage); > > You might want to try something more like: > > + for (i = 1 ; i < argc; i++) { > + if ( !strcmp(argv[i], "--help") ) > + usage(rev_list_usage); > + if ( !strcmp(argv[i], "--") ) > + break; > + } > > So that you don't break in the perverse but legal case of > having a file named "--help". Of course. Thanks! Signed-off-by: Alex Riesen <raa.lkml@gmail.com> --- diff --git a/rev-list.c b/rev-list.c index f2d1105..bcb492e 100644 --- a/rev-list.c +++ b/rev-list.c @@ -755,11 +755,20 @@ static void handle_all(struct commit_lis int main(int argc, const char **argv) { - const char *prefix = setup_git_directory(); + const char *prefix; struct commit_list *list = NULL; int i, limited = 0; for (i = 1 ; i < argc; i++) { + if ( !strcmp(argv[i], "--help") ) + usage(rev_list_usage); + if ( !strcmp(argv[i], "--") ) + break; + } + + prefix = setup_git_directory(); + + for (i = 1 ; i < argc; i++) { int flags; const char *arg = argv[i]; char *dotdot; -- 1.2.2.gbc57 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Mon Feb 20 05:39:56 2006
This archive was generated by hypermail 2.1.8 : 2006-02-20 05:41:08 EST