Add functionality to load prefs.json from profile-dir (as set with

--profile-dir on launch)

Use T: Read rather than File, so that read_prefs_from_file can be tested
This commit is contained in:
Matthew Bentley 2016-03-21 21:33:00 -04:00
parent 0397e2a24d
commit 3b93c9dde9
2 changed files with 42 additions and 10 deletions

View file

@ -799,8 +799,12 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
set_defaults(opts);
// This must happen after setting the default options, since the prefs rely on
// These must happen after setting the default options, since the prefs rely on
// on the resource path.
// Note that command line preferences have the highest precedent
if get().profile_dir.is_some() {
prefs::add_user_prefs();
}
for pref in opt_match.opt_strs("pref").iter() {
let split: Vec<&str> = pref.splitn(2, '=').collect();
let pref_name = split[0];