Title: Support for environment variables as default · Issue #94 · google/python-fire · GitHub
Open Graph Title: Support for environment variables as default · Issue #94 · google/python-fire
X Title: Support for environment variables as default · Issue #94 · google/python-fire
Description: As I user I'd like to be able to specify some of my arguments as environment variables. Quite often I have a single bash script performing many calls to a script written using python-fire. Many of the functions defined in the python scri...
Open Graph Description: As I user I'd like to be able to specify some of my arguments as environment variables. Quite often I have a single bash script performing many calls to a script written using python-fire. Many of ...
X Description: As I user I'd like to be able to specify some of my arguments as environment variables. Quite often I have a single bash script performing many calls to a script written using python-fire. Many...
Opengraph URL: https://github.com/google/python-fire/issues/94
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for environment variables as default","articleBody":"As I user I'd like to be able to specify some of my arguments as environment variables.\r\n\r\nQuite often I have a single bash script performing many calls to a script written using python-fire. Many of the functions defined in the python script contain shared arguments which I am just effectively passing from my environment variables to each of the calls. Having a way to pass those through would be extremely useful.\r\n\r\n## Desired behaviour:\r\n\r\nGiven:\r\n```python3\r\n$ cat run.py\r\nimport fire\r\ndef function_1(arg1, arg2=1):\r\n print(arg1, arg2)\r\nfire.Fire(function_1)\r\n```\r\n\r\nI'd like:\r\n```bash\r\n$ arg1=arg1 python3.6 run.py -- --use_environment\r\narg1 1\r\n$ arg1=arg1env arg2=arg2env python3.6 run.py arg1 arg2 -- --use_environment\r\narg1 arg2\r\n$ arg1=arg1env arg2=arg2env python3.6 run.py arg1 -- --use_environment\r\narg1 arg2env\r\n$ arg1=arg1env arg2=arg2env python3.6 run.py -- --use_environment\r\narg1env arg2env\r\n$ arg1=arg1env python3.6 run.py -- --use_environment\r\narg1env 1\r\n```\r\n\r\nThis would be extremely useful as then I'd be able to have the following:\r\n\r\n```bash\r\nexport HOST=mydesiredhost\r\n./machine_manager ping -- --use_environment\r\n./machine_manager shutdown -- --use_environment\r\n# No need to pass --host=mydesiredhost on each command\r\n```","author":{"url":"https://github.com/mariocj89","@type":"Person","name":"mariocj89"},"datePublished":"2017-10-06T21:35:44Z","url":"https://github.com/google/python-fire/issues/94"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5f12fa4e-a6c3-5dd9-382f-c02d7d19cd61 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98FE:392E27:916341:BC6214:6AFFE3E1 |
| html-safe-nonce | 07f97a0e7ad58f1e31eac92ff6b5301a042c96f4637456cee60616566f251ce2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEZFOjM5MkUyNzo5MTYzNDE6QkM2MjE0OjZBRkZFM0UxIiwidmlzaXRvcl9pZCI6IjU1MjE2OTU5NTEzNjc5NTU0MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 484d77832fdd2408ec36332283af286cfcae6eb6759a69c8358b88aca9983d93 |
| hovercard-subject-tag | issue:263578281 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/python-fire/94/issue_layout |
| twitter:image | https://opengraph.githubassets.com/40a4e41c374209a7d3ad3789a5143690d45f79c67c005b446acd6a7a1091bde8/google/python-fire/issues/94 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/40a4e41c374209a7d3ad3789a5143690d45f79c67c005b446acd6a7a1091bde8/google/python-fire/issues/94 |
| og:image:alt | As I user I'd like to be able to specify some of my arguments as environment variables. Quite often I have a single bash script performing many calls to a script written using python-fire. Many of ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mariocj89 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/python-fire git https://github.com/google/python-fire.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 82729529 |
| octolytics-dimension-repository_nwo | google/python-fire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82729529 |
| octolytics-dimension-repository_network_root_nwo | google/python-fire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width