Skip to content

feat(cli): implement -E log_file #277

Closed

Description

@inureyes

Part of the OpenSSH drop-in compatibility epic.

Problem

ssh -E log_file appends debug logs to a file instead of stderr. bssh does not accept it, and the whole regression suite depends on it: regress/test-exec.sh builds a wrapper script whose body is exec ${SSH} -E${logfile} "$@", so all 1071 of the suite's 1074 traced client invocations carry the flag. With bssh unmodified the suite scores 0 of 89, every test failing with error: unexpected argument '-E' found before any test logic runs.

This is also a real feature and not just harness plumbing. It is how you capture client-side diagnostics from an unattended run without interleaving them into the command's stderr.

Scope

  • Accept both -E log_file and the attached form -E<log_file>. The wrapper generated by the suite uses the attached form.
  • Send bssh's own diagnostic output to that file, appending rather than truncating, and leave the remote command's stderr on fd 2 untouched. Mixing the two defeats the purpose.
  • Apply it to the tracing subscriber as well as to the human-facing error and warning output, so a -v run lands in the file.
  • Report an inability to open the log file the way OpenSSH does, and exit rather than silently falling back to stderr.

Acceptance criteria

  • -E is accepted in both spellings and is covered by a unit test for argument parsing.
  • Diagnostics go to the named file; the remote command's own stderr does not.
  • Repeated runs append instead of truncating.
  • With -E implemented and no other change, the regress harness from the harness sub-issue reaches the test bodies instead of failing at argument parsing, and the recorded score moves off zero.

Part of #275

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions