cmd/create: Make options --image and --release mutually exclusive

... because that's what they inherently are.

https://github.com/containers/toolbox/pull/637
This commit is contained in:
Ondřej Míchal 2020-12-01 19:12:44 +01:00 committed by Debarshi Ray
parent db448ed9ce
commit 467492619a

View file

@ -102,6 +102,9 @@ func create(cmd *cobra.Command, args []string) error {
var container string
var containerArg string
if cmd.Flag("image").Changed && cmd.Flag("release").Changed {
return errors.New("options --image and --release cannot be used together")
}
if len(args) != 0 {
container = args[0]