openresty / openresty/resty-cli

[proposal] Implement environment variables support for options

Open
#30 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
269
Forks
59
Avg merge
1h 35m
Merged PRs (30d)
2

Description

Hi,

Would a contribution adding support for environment variables be accepted for options such as -c or --nginx?

The use case is using resty in a shebang as such:

#!/usr/bin/env resty -c 1024

This will only work on BSD-like platforms, and not Linux. We can mitigate this if we implement:

$ export RESTY_CLI_CONNECTION_COUNT=1024
$ export RESTY_CLI_NGINX=/path/to/nginx

Does this make sense? Which options would we like to see an environment variable for? I am thinking all but -e and the include directives (http, main, and -I), but let me know if not. Would you accept a contribution for RESTY_CLI_CONNECTION_COUNT only?

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the option-parsing code for -c and --nginx, then review how existing CLI options are defined; done means agreeing on the supported RESTY_CLI_* variables and their behavior, with coverage for the accepted scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.