11import * as yargs from "yargs" ;
22
3- import { StyleType , SummaryType , LineMatchingType , FormatType , InputType , OutputType , DiffyType } from "./types" ;
3+ import {
4+ StyleType ,
5+ SummaryType ,
6+ LineMatchingType ,
7+ FormatType ,
8+ InputType ,
9+ OutputType ,
10+ DiffyType ,
11+ DiffStyleType
12+ } from "./types" ;
413
514export type Argv = {
615 style : StyleType ;
716 synchronisedScroll : boolean ;
817 highlightCode : boolean ;
18+ diffStyle : DiffStyleType ;
919 summary : SummaryType ;
1020 matching : LineMatchingType ;
1121 matchWordsThreshold : number ;
@@ -25,6 +35,7 @@ export function setup(): Argv {
2535
2636 const styleChoices : StyleType [ ] = [ "line" , "side" ] ;
2737 const summaryChoices : SummaryType [ ] = [ "closed" , "open" , "hidden" ] ;
38+ const diffStyleChoices : DiffStyleType [ ] = [ "word" , "char" ] ;
2839 const matchingChoices : LineMatchingType [ ] = [ "lines" , "words" , "none" ] ;
2940 const formatChoices : FormatType [ ] = [ "html" , "json" ] ;
3041 const inputChoices : InputType [ ] = [ "file" , "command" , "stdin" ] ;
@@ -68,6 +79,16 @@ export function setup(): Argv {
6879 default : "closed"
6980 }
7081 } )
82+ . options ( {
83+ diff : {
84+ alias : "d" ,
85+ describe : "Diff style" ,
86+ nargs : 1 ,
87+ type : "string" ,
88+ choices : diffStyleChoices ,
89+ default : "word"
90+ }
91+ } )
7192 . options ( {
7293 matching : {
7394 alias : "lm" ,
@@ -184,6 +205,7 @@ export function setup(): Argv {
184205 ...argv ,
185206 style : argv . style as StyleType ,
186207 summary : argv . summary as SummaryType ,
208+ diffStyle : argv . diffStyle as DiffStyleType ,
187209 matching : argv . matching as LineMatchingType ,
188210 format : argv . format as FormatType ,
189211 input : argv . input as InputType ,
0 commit comments