Skip to content

Print executed commands if run in verbose mode#2852

Open
tgross35 wants to merge 1 commit intocasey:masterfrom
tgross35:verbose-cmd
Open

Print executed commands if run in verbose mode#2852
tgross35 wants to merge 1 commit intocasey:masterfrom
tgross35:verbose-cmd

Conversation

@tgross35
Copy link
Copy Markdown
Contributor

@tgross35 tgross35 commented Aug 6, 2025

It is currently difficult to debug what went wrong in cases such as OS exec errors, because verbose output prints the file but does not say how it is run. Update spawning to print executed commands with loquacious and above verbosity. The result when run with -v is something like the following:

+ cd "/home/user/workspace" && "/run/user/1000/just/just-kynaKD/configure"

The + syntax is meant to match shell scripts run with -x. This gets coloring to differentiate it.

Environment variables are not printed unless -vv is set:

+ cd "/home/user/workspace" && RUST_BACKTRACE="1" CARGO_HOME="/cargo-home" "/run/user/1000/just/just-r2rLtg/configure"

@tgross35 tgross35 force-pushed the verbose-cmd branch 5 times, most recently from 37bb91a to 1c227ab Compare August 6, 2025 05:27
It is currently difficult to debug what went wrong in cases such as OS
exec errors, because verbose output prints the file but does not say how
it is run. Update spawning to print executed commands with loquacious
and above verbosity. The result when run with `-v` is something like the
following:

    + cd "/home/user/workspace" && "/run/user/1000/just/just-kynaKD/configure"

The `+` syntax is meant to match shell scripts run with `-x`. This gets
coloring to differentiate it.

Environment variables are not printed unless `-vv` is set:

    + cd "/home/user/workspace" && RUST_BACKTRACE="1" CARGO_HOME="/cargo-home" "/run/user/1000/just/just-r2rLtg/configure"
Copy link
Copy Markdown
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for letting this sit! I think this is good, but I think that it's noisy enough that it should bet its own flag --trace, and not be part of -v. I would suggest using -vv, but -vv prints scripts, which is very annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants