@@ -1,6 +1,8 @@
11use std::ffi::OsString;
22use std::fs;
33
4+use shell_words;
5+
46use dirs::PROJECT_DIRS;
57
68pub fn get_args_from_config_file() -> Vec<OsString> {
@@ -16,6 +18,7 @@ fn get_args_from_str<'a>(content: &'a str) -> Vec<OsString> {
1618 .map(|line| line.trim())
1719 .filter(|line| !line.is_empty())
1820 .filter(|line| !line.starts_with("#"))
21+ .flat_map(|line| shell_words::split(line).unwrap())
1922 .map(|line| line.into())
2023 .collect()
2124}
@@ -23,7 +26,6 @@ fn get_args_from_str<'a>(content: &'a str) -> Vec<OsString> {
2326#[test]
2427fn empty() {
2528 let args = get_args_from_str("");
26− println!("{:?}", args);
2729 assert!(args.is_empty());
2830}
2931
@@ -41,7 +43,7 @@ fn multiple() {
4143 --color=always
4244 ";
4345 assert_eq!(
44− vec!["-p", "--style numbers,changes", "--color=always"],
46+ vec!["-p", "--style", "numbers,changes", "--color=always"],
4547 get_args_from_str(config)
4648 );
4749}
@@ -59,7 +61,7 @@ fn comments() {
5961 --color=always
6062 ";
6163 assert_eq!(
62− vec!["-p", "--style numbers,changes", "--color=always"],
64+ vec!["-p", "--style", "numbers,changes", "--color=always"],
6365 get_args_from_str(config)
6466 );
6567}