From f8aa7f6c8a632546b4cb234abf0030a39be52eed Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 26 Aug 2020 21:41:36 +0200 Subject: Add `diff_options` to parse Git diff options In order to accept Git diff options on the command line, we need a way to extract these from args. Add a function to parse diff options. These were sourced from: https://github.com/git/git/blob/675a4aaf3b226c0089108221b96559e0baae5de9/Documentation/diff-options.txt The function loops through the input arguments and extracts all diff options and their values. Still needs some work to integrate it into `git-sugdiff`, but it currently works as advertised. --- src/bin/git-sugdiff.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/bin/git-sugdiff.rs') diff --git a/src/bin/git-sugdiff.rs b/src/bin/git-sugdiff.rs index 6c96a27..6b95239 100644 --- a/src/bin/git-sugdiff.rs +++ b/src/bin/git-sugdiff.rs @@ -27,6 +27,9 @@ use github_suggestion_cli::config::Config; fn main() { let args: Vec<_> = env::args().collect(); + // TODO: Shift all diff options from args, then pass them to Config::get(). + // Add diff options to Command call below. + let config = match Config::get( &args, "usage: git sugdiff [options] ...", -- cgit v1.2.3