From e2ed6915373adf27881325ebc4e2c6b98e207af3 Mon Sep 17 00:00:00 2001 From: Omnikar Date: Wed, 27 Oct 2021 21:23:46 -0400 Subject: Implement `hx --tutor` and `:tutor` to load `tutor.txt` (#898) * Implement `hx --tutor` and `:tutor` to load `tutor.txt` * Document `hx --tutor` and `:tutor` * Change `Document::set_path` to take an `Option` * `Document::set_path` accepts an `Option<&Path>` instead of `&Path`. * Remove `Editor::open_tutor` and make tutor-open functionality use `Editor::open` and `Document::set_path`. * Use `PathBuf::join` Co-authored-by: Ivan Tham * Add comments explaining unsetting tutor path Co-authored-by: Ivan Tham --- helix-term/src/args.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'helix-term/src/args.rs') diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index f0ef09eb..40113db9 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -5,6 +5,7 @@ use std::path::PathBuf; pub struct Args { pub display_help: bool, pub display_version: bool, + pub load_tutor: bool, pub verbosity: u64, pub files: Vec, } @@ -22,6 +23,7 @@ impl Args { "--" => break, // stop parsing at this point treat the remaining as files "--version" => args.display_version = true, "--help" => args.display_help = true, + "--tutor" => args.load_tutor = true, arg if arg.starts_with("--") => { return Err(Error::msg(format!( "unexpected double dash argument: {}", -- cgit v1.2.3-70-g09d2