Skip to content

Commit 1498ec0

Browse files
committed
document environment variables
1 parent cdfc8ac commit 1498ec0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tmc-langs-cli/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
## Usage
1+
## Environment variables
22

3-
The environment variable `TMC_CORE_CLI_ROOT_URL` can be used to set the TMC server url.
3+
| var name | usage |
4+
| ---------------------- | -------------------------- |
5+
| `TMC_LANGS_ROOT_URL` | Sets the TMC server url. |
6+
| `TMC_LANGS_CONFIG_DIR` | Sets the config directory. |

tmc-langs-cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ fn run() -> Result<()> {
548548
// core
549549
if let Some(matches) = matches.subcommand_matches("core") {
550550
let root_url =
551-
env::var("TMC_CORE_CLI_ROOT_URL").unwrap_or_else(|_| "https://tmc.mooc.fi".to_string());
551+
env::var("TMC_LANGS_ROOT_URL").unwrap_or_else(|_| "https://tmc.mooc.fi".to_string());
552552
let mut core = TmcCore::new_in_config(root_url)
553553
.with_context(|| format!("Failed to create TmcCore"))?;
554554
// set progress report to print the updates to stdout as JSON
@@ -558,7 +558,7 @@ fn run() -> Result<()> {
558558
let client_name = matches.value_of("client-name").unwrap();
559559
let tmc_dir = format!("tmc-{}", client_name);
560560

561-
let config_dir = match env::var("TMC_LANGS_CLI_CONFIG_DIR") {
561+
let config_dir = match env::var("TMC_LANGS_CONFIG_DIR") {
562562
Ok(v) => PathBuf::from(v),
563563
Err(_) => dirs::config_dir().context("Failed to find config directory")?,
564564
};

0 commit comments

Comments
 (0)