Skip to content

env: require a command when --argv0 is given - #16029

Merged
sylvestre merged 2 commits into
uutils:mainfrom
Logic769:env-argv0-requires-command
Nov 2, 2026
Merged

sylvestre merged 2 commits into
uutils:mainfrom
Logic769:env-argv0-requires-command

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

env -a foo (or --argv0 foo) without a command printed the environment instead of failing. GNU env requires a command when --argv0 is given.

Change

Return a usage error (exit 125) when --argv0 is set but no command follows, with a clear message, and add regression tests.

Closes #15991

@Logic769
Logic769 force-pushed the env-argv0-requires-command branch from b57620f to e82b0b9 Compare October 30, 2026 13:02
Comment thread src/uu/env/src/env.rs Resolved
Comment thread tests/by-util/test_env.rs Resolved
@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 14.18%

1 warning, 1 note

⚠️ 122 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 2 improved benchmarks
✅ 399 untouched benchmarks
⏩ 70 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation mv_force_overwrite 154.4 ms 128.1 ms +20.56%
⚡ CPU Simulation sort_long_line[10000] 1,078.2 µs 997 µs +8.15%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Logic769:env-argv0-requires-command (b2e5610) with main (9cc868b)

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@sylvestre
sylvestre merged commit effd31f into uutils:main Nov 2, 2026
245 of 248 checks passed
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: -a/--argv0 without a command should be an error

2 participants