On Wed, 2011-08-03 at 15:11 +0200, Nikola Pajkovsky wrote:
const char *program_usage_string = _(
"\b [-v] [-c CONFFILE] -d DIR\n"
+ " or: \b [-v] --ticket NUM <file> [<file>...]\n"
To keep it consistent, use FILE, not <file>.
+ perror_msg("Can't open: '%s'",
filename);
I'd say "Can't open '%s'" (that is, without ':').
The end result will be:
Can't open FILE: ERRNO_STRING
+ if (fstat(fd, &st) != 0 || !S_ISREG(st.st_mode))
+ {
+ error_msg("Can't open: '%s': not a regular file",
filename);
The text is slightly wrong. You _can_ open it.
Just "'%s' not a regular file" is closer to the truth.
+ perror_msg("Can't lseek:
'%s'", filename);
Same about ':'
+ char *ticket_no_str = xasprintf("%i",
ticket_no);
+ rhbz_attachment(client, filename, ticket_no_str, data, /*flags*/ 0);
+ free(ticket_no_str);
Maybe we just should accept ticket_no as a string?
That is, OPT_INTEGER -> OPT_STRING.
Who knows, maybe someone has crazy bugzillas with youtube-like bug
ids? :D We can support that too!
Overall, looks good.
--
vda