diff options
| author | Teddy Wing | 2020-08-26 21:41:36 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2020-08-26 21:41:36 +0200 | 
| commit | f8aa7f6c8a632546b4cb234abf0030a39be52eed (patch) | |
| tree | 42674252405bb9a5b081827efc11ace0727252df /src/bin | |
| parent | f24e190525d7da717d0c8ac1d25fa2782ac02307 (diff) | |
| download | git-suggestion-f8aa7f6c8a632546b4cb234abf0030a39be52eed.tar.bz2 | |
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.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/git-sugdiff.rs | 3 | 
1 files changed, 3 insertions, 0 deletions
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] <suggestion>...",  | 
