-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add path flag for ignore file (#1213)
* feat: add path flag for ignore file * fix: improve migration output * refactor: clean up and test ignore util refactor: move display methods to command file * fix: improve bearer ignore show * docs: update for bearer-ignore-file flag * fix: prefer pointers for optional fields * docs: new line --------- Co-authored-by: gotbadger <[email protected]>
- Loading branch information
Showing
11 changed files
with
324 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package flag | ||
|
||
var ( | ||
BearerIgnoreFileFlag = Flag{ | ||
Name: "bearer-ignore-file", | ||
ConfigName: "bearer-ignore-file", | ||
Value: "bearer.ignore", | ||
Usage: "Load bearer.ignore file from the specified path.", | ||
DisableInConfig: true, | ||
} | ||
) | ||
|
||
type IgnoreFlagGroup struct { | ||
BearerIgnoreFileFlag *Flag | ||
} | ||
|
||
type IgnoreOptions struct { | ||
BearerIgnoreFile string `mapstructure:"ignore_bearer_ignore_file" json:"ignore_bearer_ignore_file" yaml:"ignore_bearer_ignore_file"` | ||
} | ||
|
||
func NewIgnoreFlagGroup() *IgnoreFlagGroup { | ||
return &IgnoreFlagGroup{ | ||
BearerIgnoreFileFlag: &BearerIgnoreFileFlag, | ||
} | ||
} | ||
|
||
func (f *IgnoreFlagGroup) Name() string { | ||
return "Ignore" | ||
} | ||
|
||
func (f *IgnoreFlagGroup) Flags() []*Flag { | ||
return []*Flag{ | ||
f.BearerIgnoreFileFlag, | ||
} | ||
} | ||
|
||
func (f *IgnoreFlagGroup) ToOptions() IgnoreOptions { | ||
return IgnoreOptions{ | ||
BearerIgnoreFile: getString(f.BearerIgnoreFileFlag), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.