@@ -83,13 +83,15 @@ function Get-GITParameterHint {
83
83
{
84
84
switch - RegEx ($line ) {
85
85
# -p, --param This is the parameter p
86
- " ^(-.), --([^\s\[]+)\s+([^<]*)$" {
86
+ # -p, --[no-]param This is the parameter p
87
+ " ^(-.), --(?:\[no-\]){0,1}([^\s\[]+)\s+([^<]*)$" {
87
88
$helpTable.add ($matches [1 ], @ (($matches [1 ] + " (" + $matches [2 ] + " )" ), $matches [3 ]))
88
89
$helpTable.add (" --" + $matches [2 ], @ ((" --" + $matches [2 ]), $matches [3 ]))
89
90
break
90
91
}
91
92
# --param This is the parameter p
92
- " ^--([^\s\[]+)\s+([^<]*)$" {
93
+ # --[no-]param This is the parameter p
94
+ " ^--(?:\[no-\]){0,1}([^\s\[]+)\s+([^<]*)$" {
93
95
$helpTable.add (" --" + $matches [1 ], @ ((" --" + $matches [1 ]), $matches [2 ]))
94
96
break
95
97
}
@@ -99,13 +101,15 @@ function Get-GITParameterHint {
99
101
break
100
102
}
101
103
# -p, --param <file> This is the parameter p
102
- " ^(-.), --([^\s\[]+)\s(<[^>]*>)\s+(.*)$" {
104
+ # -p, --[no-]param <file> This is the parameter p
105
+ " ^(-.), --(?:\[no-\]){0,1}([^\s\[]+)\s(<[^>]*>)\s+(.*)$" {
103
106
$helpTable.add ($matches [1 ], @ (($matches [1 ] + " (" + $matches [2 ] + " )" ), ($matches [3 ]+ " | " + $matches [4 ])))
104
107
$helpTable.add (" --" + $matches [2 ], @ ((" --" + $matches [2 ]), ($matches [3 ]+ " | " + $matches [4 ])))
105
108
break
106
109
}
107
110
# --param <file> This is the parameter p
108
- " ^--([^\s\[]+)\s(<[^>]*>)\s+(.*)$" {
111
+ # --[no-]param <file> This is the parameter p
112
+ " ^--(?:\[no-\]){0,1}([^\s\[]+)\s(<[^>]*>)\s+(.*)$" {
109
113
$helpTable.add (" --" + $matches [1 ], @ ((" --" + $matches [1 ]), ($matches [2 ]+ " | " + $matches [3 ])))
110
114
break
111
115
}
@@ -115,13 +119,15 @@ function Get-GITParameterHint {
115
119
break
116
120
}
117
121
# -p, --param[=foo] This is the parameter p
118
- " ^(-.), --([^\s\[]+)(\[[^\]]*\])\s+(.*)$" {
122
+ # -p, --[no-]param[=foo] This is the parameter p
123
+ " ^(-.), --(?:\[no-\]){0,1}([^\s\[]+)(\[[^\]]*\])\s+(.*)$" {
119
124
$helpTable.add ($matches [1 ], @ (($matches [1 ] + " (" + $matches [2 ] + " )" ), ($matches [3 ]+ " | " + $matches [4 ])))
120
125
$helpTable.add (" --" + $matches [2 ], @ ((" --" + $matches [2 ]), ($matches [3 ]+ " | " + $matches [4 ])))
121
126
break
122
127
}
123
128
# --param[=foo] This is the parameter p
124
- " ^--([^\s\[]+)(\[[^\]]*\])\s+(.*)$" {
129
+ # --[no-]param[=foo] This is the parameter p
130
+ " ^--(?:\[no-\]){0,1}([^\s\[]+)(\[[^\]]*\])\s+(.*)$" {
125
131
$helpTable.add (" --" + $matches [1 ], @ ((" --" + $matches [1 ]), ($matches [2 ]+ " | " + $matches [3 ])))
126
132
break
127
133
}
0 commit comments