-
Notifications
You must be signed in to change notification settings - Fork 20
/
cli.go
47 lines (35 loc) · 1.24 KB
/
cli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0
package github
import (
"github.com/open-component-model/ocm/pkg/cobrautils/flagsets"
"github.com/open-component-model/ocm/pkg/contexts/ocm/accessmethods/options"
)
func ConfigHandler() flagsets.ConfigOptionTypeSetHandler {
return flagsets.NewConfigOptionTypeSetHandler(
Type, AddConfig,
options.RepositoryOption,
options.HostnameOption,
options.CommitOption,
)
}
func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error {
flagsets.AddFieldByOptionP(opts, options.RepositoryOption, config, "repoUrl")
flagsets.AddFieldByOptionP(opts, options.CommitOption, config, "commit")
flagsets.AddFieldByOptionP(opts, options.HostnameOption, config, "apiHostname")
return nil
}
var usage = `
This method implements the access of the content of a git commit stored in a
GitHub repository.
`
var formatV1 = `
The type specific specification fields are:
- **<code>repoUrl</code>** *string*
Repository URL with or without scheme.
- **<code>ref</code>** (optional) *string*
Original ref used to get the commit from
- **<code>commit</code>** *string*
The sha/id of the git commit
`