-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8958617
commit 437cb83
Showing
4 changed files
with
232 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package check | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/open-component-model/ocm/cmds/ocm/pkg/options" | ||
) | ||
|
||
func From(o options.OptionSetProvider) *Option { | ||
var opt *Option | ||
o.AsOptionSet().Get(&opt) | ||
return opt | ||
} | ||
|
||
var _ options.Options = (*Option)(nil) | ||
|
||
type Option struct { | ||
CheckLocalResources bool | ||
CheckLocalSources bool | ||
} | ||
|
||
func NewOption() *Option { | ||
return &Option{} | ||
} | ||
|
||
func (o *Option) AddFlags(fs *pflag.FlagSet) { | ||
fs.BoolVarP(&o.CheckLocalResources, "local-resources", "R", false, "check also for describing resources with local access method, only") | ||
fs.BoolVarP(&o.CheckLocalSources, "local-sources", "S", false, "check also for describing sources with local access method, only") | ||
} | ||
|
||
func (o *Option) Usage() string { | ||
s := ` | ||
If the options <code>--local-resources</code> and/or <code>--local-sources</code> are given the | ||
the check additionally assures that all resources or sources are included into the component version. | ||
This means that they are using local access methods, only. | ||
` | ||
return s | ||
} |
Oops, something went wrong.