Skip to content
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

[WIP] Pass arguments beginning with dash (-) to channel programs #9058

Closed
wants to merge 1 commit into from

Conversation

clinta
Copy link
Contributor

@clinta clinta commented Jul 18, 2019

Motivation and Context

As documented in #9056, on Linux arguments beginning with - are not send to channel programs.

Description

Prefix getopt optstring with + to force the end of option scanning after the first nonoption as documented in getopt(3).

How Has This Been Tested?

tst.args_to_lua test has been modified to use arguments beginning with - to demonstrate the issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

This is a WIP first while I learn how the buildbot works and make sure the test demonstrates the bug before implementing the fix.

@clinta clinta changed the title Pass arguments beginning with dash (-) to channel programs [WIP] Pass arguments beginning with dash (-) to channel programs Jul 18, 2019
By default GNU getopt() scans all options prefixed with - preventing
them from being passed to the lua script invoked by zfs program. Setting
the POXIXLY_CORRECT variable before scanning options forces GNU getopt
to behave like Illumos and FreeBSD.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
@behlendorf
Copy link
Contributor

@clinta I'd like to close our this PR and replace it with #9428 which instead updates the documentation to require the -- separator when passing arguments to the script. Review and feedback on the documentation update would be welcome!

@behlendorf behlendorf closed this Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work in Progress Not yet ready for general review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants