AddRefopts adds the reference-related options to `flags`.
(flags *pflag.FlagSet)
| 160 | |
| 161 | // AddRefopts adds the reference-related options to `flags`. |
| 162 | func (rgb *RefGroupBuilder) AddRefopts(flags *pflag.FlagSet) { |
| 163 | flags.Var( |
| 164 | &filterValue{rgb, git.Include, "", false}, "include", |
| 165 | "include specified references", |
| 166 | ) |
| 167 | |
| 168 | flag := flags.VarPF( |
| 169 | &filterValue{rgb, git.Include, "", true}, "include-regexp", "", |
| 170 | "include references matching the specified regular expression", |
| 171 | ) |
| 172 | flag.Hidden = true |
| 173 | flag.Deprecated = "use --include=/REGEXP/" |
| 174 | |
| 175 | flags.Var( |
| 176 | &filterValue{rgb, git.Exclude, "", false}, "exclude", |
| 177 | "exclude specified references", |
| 178 | ) |
| 179 | |
| 180 | flag = flags.VarPF( |
| 181 | &filterValue{rgb, git.Exclude, "", true}, "exclude-regexp", "", |
| 182 | "exclude references matching the specified regular expression", |
| 183 | ) |
| 184 | flag.Hidden = true |
| 185 | flag.Deprecated = "use --exclude=/REGEXP/" |
| 186 | |
| 187 | flag = flags.VarPF( |
| 188 | &filterValue{rgb, git.Include, "refs/heads", false}, "branches", "", |
| 189 | "process all branches", |
| 190 | ) |
| 191 | flag.NoOptDefVal = "true" |
| 192 | |
| 193 | flag = flags.VarPF( |
| 194 | &filterValue{rgb, git.Exclude, "refs/heads", false}, "no-branches", "", |
| 195 | "exclude all branches", |
| 196 | ) |
| 197 | flag.NoOptDefVal = "true" |
| 198 | |
| 199 | flag = flags.VarPF( |
| 200 | &filterValue{rgb, git.Include, "refs/tags", false}, "tags", "", |
| 201 | "process all tags", |
| 202 | ) |
| 203 | flag.NoOptDefVal = "true" |
| 204 | |
| 205 | flag = flags.VarPF( |
| 206 | &filterValue{rgb, git.Exclude, "refs/tags", false}, "no-tags", "", |
| 207 | "exclude all tags", |
| 208 | ) |
| 209 | flag.NoOptDefVal = "true" |
| 210 | |
| 211 | flag = flags.VarPF( |
| 212 | &filterValue{rgb, git.Include, "refs/remotes", false}, "remotes", "", |
| 213 | "process all remote-tracking references", |
| 214 | ) |
| 215 | flag.NoOptDefVal = "true" |
| 216 | |
| 217 | flag = flags.VarPF( |
| 218 | &filterValue{rgb, git.Exclude, "refs/remotes", false}, "no-remotes", "", |
| 219 | "exclude all remote-tracking references", |
no outgoing calls
no test coverage detected