Skip to content

Commit 4629413

Browse files
committed
feat: jolteon print-default-key-bindings
1 parent 4409417 commit 4629413

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/actions/action.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use strum::EnumString;
66

77
use crate::toml::TomlFileError;
88

9-
static DEFAULT_ACTIONS_STR: &str = include_str!("../../assets/actions.ini");
9+
pub static DEFAULT_ACTIONS_STR: &str = include_str!("../../assets/actions.ini");
1010
static DEFAULT_ACTIONS: LazyLock<HashMap<KeyBinding, Vec<Action>>> =
1111
LazyLock::new(|| Actions::from_str(DEFAULT_ACTIONS_STR).actions);
1212

src/cli.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use lofty::{
1818
};
1919

2020
use crate::{
21-
actions::{Action, Actions},
21+
actions::{Action, Actions, DEFAULT_ACTIONS_STR},
2222
auto_update::{CARGO_PKG_VERSION, RELEASE_VERSION_OVERRIDE},
2323
duration::duration_to_string,
2424
main_player::MainPlayer,
@@ -44,6 +44,7 @@ enum OutputFormat {
4444
#[derive(Subcommand, Debug)]
4545
enum Command {
4646
PrintDefaultConfig,
47+
PrintDefaultKeyBindings,
4748
Version,
4849
About,
4950
Play {
@@ -204,6 +205,10 @@ pub fn cli() {
204205
println!("# default {} configuration:", env!("CARGO_PKG_NAME"));
205206
println!("{}", Settings::default());
206207
}
208+
Command::PrintDefaultKeyBindings => {
209+
println!("# default {} key bindings:", env!("CARGO_PKG_NAME"));
210+
println!("{}", DEFAULT_ACTIONS_STR);
211+
}
207212
Command::Version => {
208213
println!("Jolteon {}", RELEASE_VERSION_OVERRIDE.unwrap_or(CARGO_PKG_VERSION));
209214
}

0 commit comments

Comments
 (0)