|
1 | 1 | package build |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "github.com/mintoolkit/mint/pkg/app/master/command" |
5 | | - |
6 | 4 | "github.com/c-bata/go-prompt" |
| 5 | + |
| 6 | + "github.com/mintoolkit/mint/pkg/app/master/command" |
| 7 | + "github.com/mintoolkit/mint/pkg/app/master/config" |
7 | 8 | ) |
8 | 9 |
|
9 | 10 | var CommandSuggestion = prompt.Suggest{ |
@@ -163,6 +164,7 @@ var CommandFlagSuggestions = &command.FlagSuggestions{ |
163 | 164 | {Text: command.FullFlagName(FlagImageBuildEngine), Description: FlagImageBuildEngineUsage}, |
164 | 165 | {Text: command.FullFlagName(FlagImageBuildArch), Description: FlagImageBuildArchUsage}, |
165 | 166 | {Text: command.FullFlagName(FlagObfuscateMetadata), Description: FlagObfuscateMetadataUsage}, |
| 167 | + {Text: command.FullFlagName(FlagObfuscateAppPackageNames), Description: FlagObfuscateAppPackageNamesUsage}, |
166 | 168 | }, |
167 | 169 | Values: map[string]command.CompleteValue{ |
168 | 170 | command.FullFlagName(command.FlagCommandParamsFile): command.CompleteFile, |
@@ -239,9 +241,21 @@ var CommandFlagSuggestions = &command.FlagSuggestions{ |
239 | 241 | command.FullFlagName(FlagImageBuildArch): CompleteImageBuildArch, |
240 | 242 | command.FullFlagName(FlagAppImageDockerfile): command.CompleteFile, |
241 | 243 | command.FullFlagName(FlagObfuscateMetadata): command.CompleteBool, |
| 244 | + command.FullFlagName(FlagObfuscateAppPackageNames): CompleteObfuscateAPN, |
242 | 245 | }, |
243 | 246 | } |
244 | 247 |
|
| 248 | +var obfuscateAPNValues = []prompt.Suggest{ |
| 249 | + {Text: config.OAPNNone, Description: "Do no app package name obfuscation"}, |
| 250 | + {Text: config.OAPNEmpty, Description: "Replace the app package names with empty values"}, |
| 251 | + {Text: config.OAPNPrefix, Description: "Prefix app package names with a string"}, |
| 252 | + {Text: config.OAPNRandom, Description: "Replace app package names with random values"}, |
| 253 | +} |
| 254 | + |
| 255 | +func CompleteObfuscateAPN(ia *command.InteractiveApp, token string, params prompt.Document) []prompt.Suggest { |
| 256 | + return prompt.FilterHasPrefix(obfuscateAPNValues, token, true) |
| 257 | +} |
| 258 | + |
245 | 259 | var imageBuildEngineValues = []prompt.Suggest{ |
246 | 260 | {Text: IBENone, Description: "no image build engine (output image is not built)"}, |
247 | 261 | {Text: IBEInternal, Description: "internal image build engine"}, |
|
0 commit comments