-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 add builtin flags for cli pre-processing
This avoids an error-message which makes users think that recordings were not loaded. Signed-off-by: Dominik Richter <[email protected]>
- Loading branch information
Showing
4 changed files
with
142 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Mondoo, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
package plugin | ||
|
||
type FlagType byte | ||
|
||
const ( | ||
FlagType_Bool FlagType = 1 + iota | ||
FlagType_Int | ||
FlagType_String | ||
FlagType_List | ||
FlagType_KeyValue | ||
) | ||
|
||
type FlagOption byte | ||
|
||
const ( | ||
FlagOption_Hidden FlagOption = 0x1 << iota | ||
FlagOption_Deprecated | ||
FlagOption_Required | ||
FlagOption_Password | ||
// max: 8 options! | ||
) | ||
|
||
type Flag struct { | ||
Long string `json:",omitempty"` | ||
Short string `json:",omitempty"` | ||
Default string `json:",omitempty"` | ||
Desc string `json:",omitempty"` | ||
Type FlagType `json:",omitempty"` | ||
Option FlagOption `json:",omitempty"` | ||
// ConfigEntry that is used for this flag: | ||
// "" = use the same as Long | ||
// "some.other" = map to some.other field | ||
// "-" = do not read this from config | ||
ConfigEntry string `json:",omitempty"` | ||
} |
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