author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 9 Nov 2009 15:05:02 +0000 (09:05 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 20:00:21 +0000 (12:00 -0800) | ||
commit | 64b1cb74f8312c0a43ce32f51097172efc69355a | |
tree | 06b27179e155cdfbae74fa50fb59e8e9abf52ba1 | tree | snapshot |
parent | 99caeed05d3e89176d352104a2b70a77aa7e5d81 | commit | diff |
Introduce usagef() that takes a printf-style format
Some new callers would want to use printf-like formatting, when issuing
their usage messages. An option is to change usage() itself also be like
printf(), which would make it similar to die() and warn().
But usage() is typically fixed, as opposed to die() and warn() that gives
diagnostics depending on the situation. Indeed, the majority of strings
given by existing callsites to usage() are fixed strings. If we were to
make usage() take printf-style format, they all need to be changed to have
"%s" as their first argument.
So instead, introduce usagef() so that limited number of callers can use
it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Some new callers would want to use printf-like formatting, when issuing
their usage messages. An option is to change usage() itself also be like
printf(), which would make it similar to die() and warn().
But usage() is typically fixed, as opposed to die() and warn() that gives
diagnostics depending on the situation. Indeed, the majority of strings
given by existing callsites to usage() are fixed strings. If we were to
make usage() take printf-style format, they all need to be changed to have
"%s" as their first argument.
So instead, introduce usagef() so that limited number of callers can use
it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h | diff | blob | history | |
usage.c | diff | blob | history |