SQLite-backed Key / Value Store
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #18 from Tyrannican/output-environment

Add `env` command

authored by

Graham Keenan and committed by
GitHub
ea511c30 1cb1d0cf

+21 -2
+4
CHANGELOG.md
··· 2 2 3 3 Documenting changes between versions beginning from v0.3.0 4 4 5 + ## v0.10.1 6 + 7 + * Added new command to display the currently loaded environment 8 + 5 9 ## v0.10.0 6 10 7 11 * SQLite DB support
+1 -1
Cargo.lock
··· 1054 1054 1055 1055 [[package]] 1056 1056 name = "safir" 1057 - version = "0.10.0" 1057 + version = "0.10.1" 1058 1058 dependencies = [ 1059 1059 "anyhow", 1060 1060 "async-trait",
+1 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "safir" 3 - version = "0.10.0" 3 + version = "0.10.1" 4 4 edition = "2021" 5 5 authors = ["Graham Keenan <graham.keenan@outlook.com>"] 6 6 license = "MIT OR Apache-2.0"
+7
README.md
··· 38 38 clear Clear all keys/values from the store 39 39 purge Purges the .safirstore directory, removing it and its contents 40 40 use Use / create an environment to store key / value pairs 41 + env Display the current loaded environment 41 42 help Print this message or the help of the given subcommand(s) 42 43 43 44 Options: ··· 137 138 138 139 safir mode database # Switch to using an SQLite database for storage 139 140 ``` 141 + 142 + Displaying the currently loaded environment: 143 + 144 + ```bash 145 + safir env # Will display the currently loaded environment 146 + ```
+3
src/cli.rs
··· 70 70 #[arg(default_value_t = String::from("default"))] 71 71 environment: String, 72 72 }, 73 + 74 + /// Display the current loaded environment 75 + Env, 73 76 }
+5
src/main.rs
··· 47 47 cfg.write().context("writing config out")?; 48 48 println!("Using environment '{}'", environment); 49 49 } 50 + Commands::Env => { 51 + let cfg = safir.get_config(); 52 + let env = cfg.environment; 53 + println!("Currently loaded environment: '{env}'"); 54 + } 50 55 } 51 56 52 57 Ok(())