1+ //
2+ // main.c
3+ // mulle-c-string-escape
4+ //
5+ // Created by Nat! on 03.11.21
6+ // Copyright © 2021 Mulle kybernetiK. All rights reserved.
7+ // Copyright (C) 2021 Nat!, Mulle kybernetiK.
8+ //
9+ // Redistribution and use in source and binary forms, with or without
10+ // modification, are permitted provided that the following conditions are met:
11+ //
12+ // Redistributions of source code must retain the above copyright notice, this
13+ // list of conditions and the following disclaimer.
14+ //
15+ // Redistributions in binary form must reproduce the above copyright notice,
16+ // this list of conditions and the following disclaimer in the documentation
17+ // and/or other materials provided with the distribution.
18+ //
19+ // Neither the name of Mulle kybernetiK nor the names of its contributors
20+ // may be used to endorse or promote products derived from this software
21+ // without specific prior written permission.
22+ //
23+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33+ // POSSIBILITY OF SUCH DAMAGE.
34+ //
135#include "include-private.h"
236
337#include <stdio.h>
@@ -14,7 +48,7 @@ static void usage( void)
1448 printf ( "%s" , "" // keep ""
1549#include "usage.inc"
1650 );
17- exit ( 0 );
51+ exit ( 1 );
1852}
1953
2054static inline size_t calc_emit_buf_size ( size_t prefix_length ,
@@ -361,6 +395,13 @@ int main( int argc, char *argv[])
361395 usage ();
362396 continue ;
363397
398+ case 'v' :
399+ printf ( "mulle-c-string-escape %u.%u.%u\n" ,
400+ mulle_c_string_escape_get_version_major (),
401+ mulle_c_string_escape_get_version_minor (),
402+ mulle_c_string_escape_get_version_patch ());
403+ exit ( 0 );
404+
364405 default :
365406 usage ();
366407 }
0 commit comments