Skip to content

Commit cde8594

Browse files
committed
add some options to the much neglected geode config command
1 parent 70cc215 commit cde8594

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "geode"
3-
version = "3.3.2"
3+
version = "3.4.0"
44
authors = [
55
"HJfod <dreadrollmusic@gmail.com>",
66
"Camila314 <ilaca314@gmail.com>",

src/info.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ pub enum Info {
3939
Setup {},
4040
}
4141

42-
const CONFIGURABLES: [&str; 3] = ["default-developer", "sdk-path", "sdk-nightly"];
42+
const CONFIGURABLES: [&str; 6] = [
43+
"default-developer",
44+
"sdk-path",
45+
"sdk-nightly",
46+
"current-profile",
47+
"index-token",
48+
"index-url",
49+
];
4350

4451
fn get_bool(value: &str) -> Option<bool> {
4552
let lower = value.to_ascii_lowercase();
@@ -68,6 +75,11 @@ pub fn subcommand(cmd: Info) {
6875
} else if field == "sdk-path" {
6976
fail!("Set the SDK Path using `geode sdk set-path <PATH>`");
7077
return;
78+
} else if field == "index-token" {
79+
config.index_token = Some(value);
80+
} else if field == "index-url" {
81+
fail!("Set the Index URL using `geode index set-url <URL>`");
82+
return;
7183
} else {
7284
fail!("Unknown field {}", field);
7385
return;
@@ -93,6 +105,12 @@ pub fn subcommand(cmd: Info) {
93105
} else {
94106
"false"
95107
}
108+
} else if field == "current-profile" {
109+
config.current_profile.as_deref().unwrap_or("")
110+
} else if field == "index-token" {
111+
config.index_token.as_deref().unwrap_or("")
112+
} else if field == "index-url" {
113+
config.index_url.as_ref()
96114
} else if raw {
97115
std::process::exit(1);
98116
} else {

0 commit comments

Comments
 (0)