+
Skip to content

env: ignore flags after the command or -- argument #7781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025

Conversation

dan-hipschman
Copy link
Contributor

@dan-hipschman dan-hipschman commented Apr 18, 2025

Fixes #7750

Problem: env applies special case logic to some args, such as -u and -S. However, it applies this logic to args that are supposed to be only for the program it invokes.

Solution: In the code that special cases certain args, figure out when we've gotten to the command name and stop processing.

This also puts long option names into constants since they're used in a few places now.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@dan-hipschman dan-hipschman marked this pull request as draft April 18, 2025 20:51
@dan-hipschman dan-hipschman force-pushed the env-ignore-flags-after-command branch 3 times, most recently from 902ee7f to c271438 Compare April 18, 2025 22:06
Copy link

GNU testsuite comparison:

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

@dan-hipschman dan-hipschman force-pushed the env-ignore-flags-after-command branch from c271438 to 04b4280 Compare April 18, 2025 22:41
Copy link

GNU testsuite comparison:

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

@dan-hipschman dan-hipschman marked this pull request as ready for review April 18, 2025 23:17
@dan-hipschman dan-hipschman force-pushed the env-ignore-flags-after-command branch from 04b4280 to 4282ec6 Compare April 19, 2025 01:41
@dan-hipschman dan-hipschman force-pushed the env-ignore-flags-after-command branch from 4282ec6 to 814e82e Compare April 19, 2025 01:48
Copy link

GNU testsuite comparison:

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

@cakebaker cakebaker merged commit 1d89ea5 into uutils:main Apr 19, 2025
70 checks passed
@cakebaker
Copy link
Contributor

Thanks!

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.

env: currently tries to parse too many arguments
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载