add --accounts-index-path to be used by disk accounts index (#19710)
* add --accounts-index-paths to be used by disk accounts index * add multiple and default to help
This commit is contained in:
committed by
GitHub
parent
320beb76f6
commit
5810568c65
@ -2011,6 +2011,16 @@ pub fn main() {
|
||||
.takes_value(true)
|
||||
.help("Number of bins to divide the accounts index into"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("accounts_index_path")
|
||||
.long("accounts-index-path")
|
||||
.value_name("PATH")
|
||||
.takes_value(true)
|
||||
.multiple(true)
|
||||
.help("Persistent accounts-index location. \
|
||||
May be specified multiple times. \
|
||||
[default: [ledger]/accounts_index]"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("accounts_db_test_hash_calculation")
|
||||
.long("accounts-db-test-hash-calculation")
|
||||
@ -2530,7 +2540,14 @@ pub fn main() {
|
||||
}
|
||||
|
||||
{
|
||||
let mut accounts_index_paths = vec![]; // will be option soon
|
||||
let mut accounts_index_paths: Vec<PathBuf> = if matches.is_present("accounts_index_path") {
|
||||
values_t_or_exit!(matches, "accounts_index_path", String)
|
||||
.into_iter()
|
||||
.map(PathBuf::from)
|
||||
.collect()
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
if accounts_index_paths.is_empty() {
|
||||
accounts_index_paths = vec![ledger_path.join("accounts_index")];
|
||||
}
|
||||
|
Reference in New Issue
Block a user