Skip to content

Conversation

sylvestre
Copy link
Contributor

@sylvestre sylvestre commented Sep 1, 2025

and add tests to make sure we don't regress in the future

@sylvestre
Copy link
Contributor Author

Some GNU tests will fail.

Copy link

github-actions bot commented Sep 1, 2025

GNU testsuite comparison:

GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mv/diag. tests/mv/diag is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)

Copy link

github-actions bot commented Sep 2, 2025

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Copy link

github-actions bot commented Sep 2, 2025

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre force-pushed the clap-loca-improv-2 branch 2 times, most recently from 5e23a1b to 12220a7 Compare September 3, 2025 17:57
Copy link

github-actions bot commented Sep 3, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre marked this pull request as ready for review September 3, 2025 18:47
@sylvestre sylvestre requested a review from cakebaker September 3, 2025 18:47
Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Comment on lines 560 to 568
let colors_enabled = match color_choice {
clap::ColorChoice::Always => true,
clap::ColorChoice::Never => false,
clap::ColorChoice::Auto => {
use std::io::IsTerminal;
IsTerminal::is_terminal(&std::io::stdout())
&& std::env::var("TERM").unwrap_or_default() != "dumb"
}
};
Copy link
Contributor

@cakebaker cakebaker Sep 4, 2025

Choose a reason for hiding this comment

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

This snippet is almost identical with the should_use_color_stderr function, the only difference is in what is passed to is_terminal. Maybe should_use_color_stderr can be made more flexible so that it can be used here, too?

Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)


let help_text = err.render().to_string();
/// Manages color output based on environment settings
struct ColorManager(bool);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm undecided whether a ColorManager concept is necessary or a bool property in ErrorFormatter would be enough.

.about(translate!("printenv-about"))
.override_usage(format_usage(&translate!("printenv-usage")))
.infer_long_args(true)
.infer_long_args(true);
uucore::clap_localization::configure_localized_command(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

.about(translate!("runcon-about"))
.after_help(translate!("runcon-after-help"))
.override_usage(format_usage(&translate!("runcon-usage")))
.infer_long_args(true)
.infer_long_args(true);
uucore::clap_localization::configure_localized_command(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

.about(translate!("truncate-about"))
.override_usage(format_usage(&translate!("truncate-usage")))
.infer_long_args(true)
.infer_long_args(true);
uucore::clap_localization::configure_localized_command(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

.about(translate!("uniq-about"))
.override_usage(format_usage(&translate!("uniq-usage")))
.infer_long_args(true)
.after_help(translate!("uniq-after-help"))
.after_help(translate!("uniq-after-help"));
uucore::clap_localization::configure_localized_command(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

.about(about)
.override_usage(format_usage(&translate!("who-usage")))
.infer_long_args(true)
.infer_long_args(true);
uucore::clap_localization::configure_localized_command(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Copy link
Contributor

@cakebaker cakebaker left a comment

Choose a reason for hiding this comment

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

Done :)

Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

@sylvestre sylvestre force-pushed the clap-loca-improv-2 branch 3 times, most recently from 251e258 to ee0fae5 Compare September 4, 2025 21:26
Copy link

github-actions bot commented Sep 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

@sylvestre sylvestre requested a review from cakebaker September 4, 2025 21:49
Copy link

github-actions bot commented Sep 5, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@cakebaker cakebaker merged commit 303a211 into uutils:main Sep 5, 2025
131 of 136 checks passed
@cakebaker
Copy link
Contributor

Good work :)

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