Skip to content

Conversation

@0x61nas
Copy link
Contributor

@0x61nas 0x61nas commented Oct 5, 2025

Introduce -k,--key-bindings, -s, and --key-symbols arguments to allow the user from specifying a custom config files without having to change the global ones

This Pull Request fixes/closes #2714.

It changes the following:

I followed the checklist:

  • I added unittests
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

…e via the cli

Introduce `-k`,`--key-bindings`, `-s`, and `--key-symbols` arguments to allow the user from specifying a custom config files without having to change the global ones

this change is meant to address github issue: gitui-org#2714
@0x61nas 0x61nas force-pushed the feat/custom-configs-path branch from c678978 to 5a14779 Compare October 5, 2025 17:42
@extrawurst extrawurst requested a review from cruessler October 28, 2025 15:53
@extrawurst extrawurst added this to the v0.28 milestone Oct 28, 2025
Copy link
Collaborator

@cruessler cruessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the PR locally, I didn’t find any issues. There’s just a few suggestions for refactoring and a typo.

Arg::new("key_symbols")
.help("Use a custom symbols file")
.short('s')
.long("key-symblos")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: this should by key-symbols.

Comment on lines +42 to +46
if !path.exists() {
return Err(anyhow!(
"The custom key bindings file dosen't exists"
));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can be removed as KeysList::init calls File::open which will error if the file does not exist.

Comment on lines +53 to +57
if !path.exists() {
return Err(anyhow!(
"The custom key symbols file dosen't exists"
));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can be removed as KeysList::init calls File::open which will error if the file does not exist.

"The custom key bindings file dosen't exists"
));
}
KeysList::init(path.clone())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about something like KeysList::init(key_bindings_path.unwrap_or(Self::get_config_file()?))? (Same below for symbols.)

Copy link
Collaborator

@cruessler cruessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t mean to approve just yet, this was by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --config CLI argument

3 participants