Skip to content

Honor -- when filtering base-bash wrapper arguments #159

Description

@codeforester

Problem

The stdlib initializer and standalone launcher scan every argument for wrapper flags. They do not stop at the conventional -- delimiter.

At main commit a107134, sourcing the stdlib with alpha -- --color omega leaves alpha -- omega; the target script can never receive a literal --color after the delimiter. base_bash_filter_runtime_args duplicates the same behavior. It also publishes its temporary result through an undeclared global base_bash_runtime_args.

Separately, base-bash --help prints normal help but exits with status 2, the same as missing required input.

Scope

  • Stop wrapper-option interpretation after the first standalone -- and preserve the entire remaining argument tail.
  • Keep recognized wrapper flags before the delimiter working as today.
  • Ensure top-level target-script arguments and main arguments are identical.
  • Keep launcher filtering state local or caller-owned instead of leaking a generic global.
  • Return 0 for explicit help and a usage status for a missing script.

Acceptance Criteria

  • base-bash script -- --color delivers -- --color to both the sourced script body and main.
  • Wrapper flags before -- are consumed exactly once and still configure logging.
  • The launcher exposes no filtering scratch global to the target script.
  • base-bash --help returns 0; invoking without a script remains a usage failure.

Validation

  • bats tests/launcher.bats lib/bash/std/tests/lib_std.bats
  • ./tests/validate.sh
  • git diff --check

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions