From 4f2dff429af2bef6175ee96a7566fc1d13b12f8a Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Mon, 6 Dec 2021 13:44:39 +0800 Subject: [PATCH] Add list_config into query_comile_time_config Signed-off-by: Jerry Yu --- programs/test/query_compile_time_config.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/programs/test/query_compile_time_config.c b/programs/test/query_compile_time_config.c index 0e356c822..6a2d10e78 100644 --- a/programs/test/query_compile_time_config.c +++ b/programs/test/query_compile_time_config.c @@ -33,13 +33,14 @@ #endif #define USAGE \ - "usage: %s \n\n" \ + "usage: %s | -l\n\n" \ "This program takes one command line argument which corresponds to\n" \ "the string representation of a Mbed TLS compile time configuration.\n" \ "The value 0 will be returned if this configuration is defined in the\n" \ "Mbed TLS build and the macro expansion of that configuration will be\n" \ - "printed (if any). Otherwise, 1 will be returned.\n" - + "printed (if any). Otherwise, 1 will be returned.\n" \ + "-l\tPrint all available configuration" +#include #include "query_config.h" int main( int argc, char *argv[] ) @@ -50,5 +51,11 @@ int main( int argc, char *argv[] ) return( MBEDTLS_EXIT_FAILURE ); } + if( strcmp( argv[1], "-l" ) == 0 ) + { + list_config(); + return( 0 ); + } + return( query_config( argv[1] ) ); }