mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
parent
bec1fb939a
commit
702c49a147
2 changed files with 14 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
- add `-d`, `--directory` options to set starting working directory
|
||||
|
||||
### Changed
|
||||
- changed hotkeys for selecting stage/workdir (**[w] / [s]** now to change between workdir and stage) and added hotkeys (`[1234]`) to switch to tabs directly ([#92](https://github.com/extrawurst/gitui/issues/92))
|
||||
|
|
|
|||
13
src/main.rs
13
src/main.rs
|
|
@ -234,6 +234,13 @@ fn process_cmdline() -> Result<()> {
|
|||
.help("Stores logging output into a cache directory")
|
||||
.short("l")
|
||||
.long("logging"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("directory")
|
||||
.help("Set the working directory")
|
||||
.short("d")
|
||||
.long("directory")
|
||||
.takes_value(true),
|
||||
);
|
||||
|
||||
let arg_matches = app.get_matches();
|
||||
|
|
@ -241,6 +248,12 @@ fn process_cmdline() -> Result<()> {
|
|||
setup_logging()?;
|
||||
}
|
||||
|
||||
if arg_matches.is_present("directory") {
|
||||
let directory =
|
||||
arg_matches.value_of("directory").unwrap_or(".");
|
||||
env::set_current_dir(directory)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue