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

Implement InputKind Env #98

Closed
SteveL-MSFT opened this issue Jul 13, 2023 · 6 comments · Fixed by #198
Closed

Implement InputKind Env #98

SteveL-MSFT opened this issue Jul 13, 2023 · 6 comments · Fixed by #198
Assignees
Labels
Issue-Enhancement The issue is a feature or idea

Comments

@SteveL-MSFT
Copy link
Member

Summary of the new feature / enhancement

InputKind = Args is intended for simple cases like bash script resource where a flat JSON schema would result as name/value pairs sent as parameters and parameter values to the script:

{
  "property1": 1,
  "property2": "hello"
}

Would result in:

yourresource -property1 1 -property2 "hello"

Proposed technical implementation details (optional)

No response

@SteveL-MSFT SteveL-MSFT added the Issue-Enhancement The issue is a feature or idea label Jul 13, 2023
@michaeltlombardi
Copy link
Collaborator

Do we need a way to distinguish between --flag and -f or should we always assume the former as convention for xplat executables?

@SteveL-MSFT
Copy link
Member Author

Yes, I hadn't thought about this until I read your draft doc. Even worse, on Windows, it's not uncommon to see /f. So I think args InputKind probably needs an optional member called prefix which defaults to --, but can be set to whatever is needed.

@SteveL-MSFT
Copy link
Member Author

Complex/nested objects won't be supported for this and will error rather than trying to pass JSON fragment

@SteveL-MSFT SteveL-MSFT self-assigned this Jul 29, 2023
@SteveL-MSFT SteveL-MSFT removed their assignment Aug 29, 2023
@SteveL-MSFT SteveL-MSFT self-assigned this Sep 17, 2023
@SteveL-MSFT
Copy link
Member Author

Was thinking about this and looked up how to parse args in Bash. It's actually quite complicated and requires not obvious code. Like batch files, it's more optimized for positional parameters. Instead, it's much easier to deal with env vars. So I'm changing this to passing input as named env vars.

@SteveL-MSFT SteveL-MSFT changed the title Implement InputKind Args Implement InputKind Env Sep 17, 2023
@michaeltlombardi
Copy link
Collaborator

Should we not support both? Or are we prioritizing env vars now and args later?

@SteveL-MSFT
Copy link
Member Author

We can add args support when a use case comes up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants