3 gettext-util.c - git gettext utility for Mac OS X
4 Copyright (C) 2014,2015 Kyle J. McKay. All rights reserved.
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "git-compat-util.h"
25 int main(int argc
, char **argv
)
27 const char usage
[] = "Usage: git gettext MSGID [MSGID_PLURAL N]";
29 if (argc
!= 2 && argc
!= 4)
33 n
= strtol(argv
[3], &end
, 10);
34 if (!argv
[3][0] || *end
|| n
< 0)
39 printf("%s", ngettext(argv
[1], argv
[2], (unsigned long)n
));
41 printf("%s", gettext(argv
[1]));