argpar.git
2 years agoImport warning flags and tap from Babeltrace
Simon Marchi [Fri, 21 May 2021 03:23:21 +0000 (23:23 -0400)] 
Import warning flags and tap from Babeltrace

Since we are going to use this code in Babeltrace, lttng-tools, and
perhaps other projects, I think it would be useful to use warning flags
at least as strict here as we do in these other projects, so we don't
have bad surprises when importing the code there.

Start by importing the warning flag checking system from Babeltrace, and
the list of warning flags used there.

Import the tap code as well, since the current tap code would generate
some errors with the new warning flags.

Change-Id: I86bf5a18bcbce35b887d3ef3285d5566b3f7c69f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
3 years agoUse SPDX-style license header
Simon Marchi [Sat, 10 Apr 2021 13:44:03 +0000 (09:44 -0400)] 
Use SPDX-style license header

This is copied from the lttng-tools repo.  In that repo, the comment is
above the header include guard, so I put it at the same place here.

Change-Id: If71e76e78fe2d4347b5ef24d37126ce7f33fb0a1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
3 years agoFix: Error out when passing an argument to long option that takes no argument
Simon Marchi [Fri, 9 Apr 2021 16:39:19 +0000 (12:39 -0400)] 
Fix: Error out when passing an argument to long option that takes no argument

If the user defines a long option `--foo` and passes `--foo=arg`, the
current behavior is that the option foo is recognized and the argument
is ignored.  Change that to be an error.

It is currently not possible to pass arguments to short options using an
equal sign, so this doesn't apply to short options.

Change-Id: I4b0c50398161aebc81789fdb3fce19a80a5f6646
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoAdd format attributes to functions with format strings
Simon Marchi [Sun, 15 Mar 2020 19:36:10 +0000 (15:36 -0400)] 
Add format attributes to functions with format strings

Compiling with -Wsuggest-attribute=format shows that these functions
could use a format attribute, which helps the compiler validate format
strings.  This patch adds them.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Change-Id: I2884d13b08d9ea67680289e59fb40ebdfecdc3d4

4 years agoAdd missing va_end in argpar_vasprintf
Simon Marchi [Fri, 6 Dec 2019 19:23:29 +0000 (14:23 -0500)] 
Add missing va_end in argpar_vasprintf

args2 is currently leaked, we need to call va_end on it.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoRemove bt_/BT_ prefixes throughout
Simon Marchi [Thu, 5 Dec 2019 18:57:11 +0000 (13:57 -0500)] 
Remove bt_/BT_ prefixes throughout

Since this is not longer part of Babeltrace, remove the bt_/BT_
prefixes.  This was done mechanically using:

    sed -i -e 's/BT_ARGPAR/ARGPAR/g' -e 's/bt_argpar/argpar/g'

Hopefully there isn't too much collateral damage.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoFix comments in bt_argpar_item_array, data -> items
Simon Marchi [Thu, 5 Dec 2019 18:27:09 +0000 (13:27 -0500)] 
Fix comments in bt_argpar_item_array, data -> items

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoStrip trailing spaces
Simon Marchi [Wed, 4 Dec 2019 22:58:36 +0000 (17:58 -0500)] 
Strip trailing spaces

4 years agoAdd bootstrap script
Simon Marchi [Wed, 4 Dec 2019 22:33:56 +0000 (17:33 -0500)] 
Add bootstrap script

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoAdd .gitignore
Simon Marchi [Wed, 4 Dec 2019 21:12:56 +0000 (16:12 -0500)] 
Add .gitignore

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoAdd build system, remove dependency on glib, add TAP library
Simon Marchi [Wed, 4 Dec 2019 22:33:56 +0000 (17:33 -0500)] 
Add build system, remove dependency on glib, add TAP library

This commit...

 * adds an automake-based system.
 * removes glib dependencies from the library code (i.e. not from the tests),
   replacing them with home-grown code.
 * sets up the tests to run using the TAP library [1].

[1] https://github.com/shlomif/libtap-prev

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
4 years agoInitial commit
Simon Marchi [Wed, 4 Dec 2019 16:51:08 +0000 (11:51 -0500)] 
Initial commit

Copy source and tests from the babeltrace repository, commit:

    23256fd15c8ac7d1faaa3e37d0df2e225e90a6c6
    bt2: reverse order of printed causes in _Error.__str__

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
This page took 0.024061 seconds and 4 git commands to generate.