File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ public string GetUsage(int padLeft = _DEFAULT_PAD_LEFT)
9090 current + option . Key . ToString ( ) . PadLeft ( padLeft ) + " = " + option . Key . Description + "\n " ) ;
9191 }
9292
93+ public void ForceState ( string arg , Argument . Ask ask ) => _options . Keys . First ( k => k . Names . Contains ( arg ) ) . Asked = ask ;
94+
9395 public void CheckRequired ( )
9496 {
9597 foreach ( Argument argument in _options . Keys . Where ( a => a . Asked == Argument . Ask . Required && ! IsSpecified ( a . Names [ 0 ] ) ) )
@@ -108,7 +110,7 @@ public enum Ask
108110
109111 public string [ ] Names { get ; }
110112 public string Description { get ; }
111- public Ask Asked { get ; }
113+ public Ask Asked { get ; internal set ; }
112114
113115 internal Argument ( string name , string desc ) : this ( new [ ] { name } , desc ) { }
114116
@@ -125,7 +127,8 @@ internal Argument(string[] names, string desc)
125127 Asked = Ask . Optional ;
126128 }
127129
128- private bool Equals ( Argument other ) => other . Names . Any ( s => Names . Contains ( s ) ) ;
130+ private bool Equals ( Argument other ) => other . Names . Any ( s => Names . Contains ( s ) ||
131+ Names . Contains ( "-" + s ) || Names . Contains ( "--" + s ) ) ;
129132
130133 public override string ToString ( ) => string . Join ( ", " , Names ) ;
131134
You can’t perform that action at this time.
0 commit comments