Skip to content

Commit

Permalink
#24: eoc compatible mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 5, 2022
1 parent a0dbffb commit ffe9ec7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/bin/reo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ pub fn main() {
.takes_value(false)
.help("Print all possible debug messages"),
)
.arg(
Arg::new("eoc")
.long("eoc")
.required(false)
.takes_value(false)
.help("Compatibility with eoc command-line toolkit"),
)
.arg(
Arg::new("file")
.long("file")
Expand Down Expand Up @@ -93,7 +100,14 @@ pub fn main() {
match matches.subcommand() {
Some(("dataize", subs)) => {
let object = subs.get_one::<String>("object").unwrap();
let home = matches.value_of("dir").unwrap_or_default();
let home = matches.value_of("dir").unwrap_or_else(
|| if matches.contains_id("eoc") {
debug!("Running in eoc-compatible mode");
".eoc/gmi"
} else {
"."
}
);
debug!("Home requested as '{}'", home);
let full_home = fs::canonicalize(home)
.context(format!("Can't access '{}'", home))
Expand Down

0 comments on commit ffe9ec7

Please sign in to comment.