Put verbose messages on a command-line argument, finally, and format the messages a bit better.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4625 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-11-09 00:28:34 +00:00
parent 5fff3b8161
commit a6c8dd846c
3 changed files with 42 additions and 3 deletions

View File

@ -276,6 +276,7 @@ typedef struct tf_run_args_t {
const char* args;
const char* zip;
bool one_proc;
bool verbose;
bool help;
} tf_run_args_t;
@ -307,6 +308,7 @@ static int _tf_run_task(const tf_run_args_t* args, int index)
}
tf_task_set_db_path(task, db_path);
tf_task_activate(task);
tf_ssb_set_verbose(tf_task_get_ssb(task), args->verbose);
tf_ssb_start_periodic(tf_task_get_ssb(task));
if (args->zip)
{
@ -393,6 +395,7 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
{ "args", 'a', offsetof(tf_run_args_t, args), NULL, XOPT_TYPE_STRING, NULL, "Arguments of the form key=value,foo=bar,verbose=true." },
{ "one-proc", 'o', offsetof(tf_run_args_t, one_proc), NULL, XOPT_TYPE_BOOL, NULL, "Run everything in one process (unsafely!)." },
{ "zip", 'z', offsetof(tf_run_args_t, zip), NULL, XOPT_TYPE_STRING, NULL, "Zip archive from which to load files." },
{ "verbose", 'v', offsetof(tf_run_args_t, verbose), NULL, XOPT_TYPE_BOOL, NULL, "Log raw messages." },
{ "help", 'h', offsetof(tf_run_args_t, help), NULL, XOPT_TYPE_BOOL, NULL, "Shows this help message." },
XOPT_NULLOPTION,
};