fix(chaipa): Remove pretty print to avoid clang-tidy / added the options in echo
This commit is contained in:
parent
3cd231f031
commit
182e31b42e
7 changed files with 106 additions and 34 deletions
|
|
@ -67,7 +67,7 @@ int args_handler(int argc, char **argv, struct args_options *options,
|
|||
{
|
||||
options->type = INPUT_UNDEFINED;
|
||||
options->input_source = NULL;
|
||||
options->pretty_print = false;
|
||||
// options->pretty_print = false;
|
||||
options->verbose = false;
|
||||
|
||||
struct list *args_list = NULL;
|
||||
|
|
@ -76,11 +76,11 @@ int args_handler(int argc, char **argv, struct args_options *options,
|
|||
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "--pretty-print") == 0)
|
||||
/* if (strcmp(argv[i], "--pretty-print") == 0)
|
||||
{
|
||||
options->pretty_print = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "--verbose") == 0)
|
||||
} */
|
||||
if (strcmp(argv[i], "--verbose") == 0)
|
||||
{
|
||||
options->verbose = true;
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ void args_print(struct args_options *options)
|
|||
: "UNDEFINED");
|
||||
printf("Input source: %s\n",
|
||||
options->input_source ? options->input_source : "NULL");
|
||||
printf("Pretty print: %s\n", options->pretty_print ? "true" : "false");
|
||||
// printf("Pretty print: %s\n", options->pretty_print ? "true" : "false");
|
||||
printf("Verbose: %s\n", options->verbose ? "true" : "false");
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,8 @@ void print_usage(FILE *std, const char *program_name)
|
|||
fprintf(std, "Usage: %s [OPTIONS] [SCRIPT] [ARGUMENTS...]\n", program_name);
|
||||
fprintf(std, "Options:\n");
|
||||
fprintf(std, " -c [SCRIPT] Execute the given command string.\n");
|
||||
fprintf(std, " --pretty-print Enable pretty printing of outputs.\n");
|
||||
// fprintf(std, " --pretty-print Enable pretty printing of
|
||||
// outputs.\n");
|
||||
fprintf(std, " --verbose Enable verbose mode.\n");
|
||||
fprintf(std,
|
||||
"If no SCRIPT is provided, input is read from standard input.\n");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ struct args_options
|
|||
/** Type of the input source */
|
||||
enum input_type type;
|
||||
/** Enable or disable pretty printing of outputs */
|
||||
bool pretty_print;
|
||||
// bool pretty_print;
|
||||
/** Enable or disable verbose mode */
|
||||
bool verbose;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct ast *ast_create(enum ast_type type, void *data)
|
|||
return node;
|
||||
}
|
||||
|
||||
// TODO handle new types (AST_WORD, AST_PIPE, etc.)
|
||||
/* // TODO handle new types (AST_WORD, AST_PIPE, etc.)
|
||||
static void ast_print_dot_recursive(struct ast *node, FILE *out)
|
||||
{
|
||||
if (!node)
|
||||
|
|
@ -170,3 +170,4 @@ void ast_print_dot(struct ast *ast)
|
|||
fprintf(dot_pipe, "}\n");
|
||||
pclose(dot_pipe);
|
||||
}
|
||||
*/
|
||||
|
|
@ -16,9 +16,4 @@
|
|||
#include "ast_void.h"
|
||||
#include "ast_word.h"
|
||||
|
||||
/**
|
||||
* Prints the Graphviz DOT representation of the given AST to stdout.
|
||||
*/
|
||||
void ast_print_dot(struct ast *ast);
|
||||
|
||||
#endif /* ! AST_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue