diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py index e94845dae2e6be74368db72c7d990104b8ff7721..699e8a9cde52e40728da20dce776c70826aca5d4 100644 --- a/binarycpython/utils/functions.py +++ b/binarycpython/utils/functions.py @@ -53,11 +53,16 @@ def get_help(param_name, return_dict): - available macros This function reads out that structure and catches the different components of this output - Presenting it in + + Will print a dict + + return_dict: wether to return the help info dictionary """ - if param_name in get_arg_keys(): + available_arg_keys = get_arg_keys() + + if param_name in available_arg_keys: help_info = binary_c_python_api.return_help(param_name) cleaned = [el for el in help_info.split('\n') if not el==''] @@ -104,12 +109,9 @@ def get_help(param_name, return_dict): if return_dict: return help_info_dict - - -get_help('RLOF_method', return_dict=True) - - - + else: + print("{} is not a valid parameter name. Please choose from the following parameters:\n\t{}".format(param_name, list(available_arg_keys))) + return None def run_system(**kwargs): """ diff --git a/include/binary_c_python.h b/include/binary_c_python.h index 29979236ed26c9929c013c4f34a8b6fb5d75f2f0..e2a48e16ff80da443fec1cc16d992058306a888d 100644 --- a/include/binary_c_python.h +++ b/include/binary_c_python.h @@ -9,12 +9,12 @@ #include "binary_c_API_prototypes.h" /* Binary_c's python API prototypes */ -int run_binary (char * argstring, +int run_binary(char * argstring, char ** const outstring, char ** const errorstring, size_t * const nbytes); -int run_binary_with_logfile (char * argstring, +int run_binary_with_logfile(char * argstring, char ** const outstring, char ** const errorstring, size_t * const nbytes); @@ -29,6 +29,13 @@ int return_arglines(char ** const outstring, char ** const errorstring, size_t * const nbytes); +int return_help_info(char * argstring, + char ** const outstring, + char ** const errorstring, + size_t * const nbytes); + + + /* C macros */ #define BINARY_C_APITEST_VERSION 0.1 #define APIprint(...) APIprintf(__VA_ARGS__);