mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
a7f1d2c0c7
This adds support for `fish_trace`, a new variable intended to serve the same purpose as `set -x` as in bash. Setting this variable to anything non-empty causes execution to be traced. In the future we may give more specific meaning to the value of the variable. The user's prompt is not traced unless you run it explicitly. Events are also not traced because it is noisy; however autoloading is. Fixes #3427
23 lines
691 B
C++
23 lines
691 B
C++
/// Support for fish_trace.
|
|
#ifndef FISH_TRACE_H
|
|
#define FISH_TRACE_H
|
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include "common.h"
|
|
|
|
class parser_t;
|
|
class process_t;
|
|
|
|
/// Trace an "argv": a list of arguments. Each argument is escaped.
|
|
/// If \p command is not null, it is traced first (and not escaped)
|
|
void trace_argv(const parser_t &parser, const wchar_t *command, const wcstring_list_t &argv);
|
|
|
|
/// \return whether tracing is enabled.
|
|
bool trace_enabled(const parser_t &parser);
|
|
|
|
/// Convenience helper to trace a single string if tracing is enabled.
|
|
void trace_if_enabled(const parser_t &parser, const wchar_t *command,
|
|
const wcstring_list_t &argv = {});
|
|
|
|
#endif
|