Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more path mappings #877

Merged
merged 5 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmds/ocm/commands/toicmds/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ func NewCommand(ctx clictx.Context) *cobra.Command {
TOI is an abbreviation for (T)iny (O)CM (I)nstallation. It is a simple
application framework on top of the Open Component Model, that can
be used to describe image based installation executors and installation
packages (see topic <CMD>ocm toi bootstrapping</CMD> in form of resources
packages (see topic <CMD>ocm toi-bootstrapping</CMD> in form of resources
with a dedicated type. All involved resources are hereby taken from a component
version of the Open Component Model, which supports all the OCM features, like
transportation.

The framework consists of a generic bootstrap command
(<CMD>ocm toi bootstrap componentversions</CMD>) and an arbitrary set of image
(<CMD>ocm bootstrap package</CMD>) and an arbitrary set of image
based executors, that are executed in containers and fed with the required
installation data by th generic command.
`,
Expand All @@ -39,7 +39,7 @@ installation data by th generic command.
cmd.AddCommand(bootstrap.NewCommand(ctx))
cmd.AddCommand(describe.NewCommand(ctx))

cmd.AddCommand(topicocmrefs.New(ctx))
cmd.AddCommand(topicbootstrap.New(ctx, "bootstrapping"))
cmd.AddCommand(utils.DocuCommandPath(topicocmrefs.New(ctx), "ocm"))
cmd.AddCommand(utils.DocuCommandPath(topicbootstrap.New(ctx, "bootstrapping"), "ocm", "toi-bootstrapping"))
return cmd
}
6 changes: 4 additions & 2 deletions cmds/ocm/common/utils/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"

"github.com/mandelsoft/goutils/errors"
"github.com/mandelsoft/goutils/general"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

Expand Down Expand Up @@ -110,11 +111,12 @@ func OverviewCommand(cmd *cobra.Command) *cobra.Command {
return cmd
}

func DocuCommandPath(cmd *cobra.Command, path string) *cobra.Command {
func DocuCommandPath(cmd *cobra.Command, path string, optname ...string) *cobra.Command {
name := general.OptionalDefaulted(cmd.Name(), optname...)
if cmd.Annotations == nil {
cmd.Annotations = map[string]string{}
}
cmd.Annotations["commandPath"] = path + " " + cmd.Name()
cmd.Annotations["commandPath"] = path + " " + name
return cmd
}

Expand Down
10 changes: 5 additions & 5 deletions docs/reference/ocm_toi.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ ocm toi [<options>] <sub command> ...
TOI is an abbreviation for (T)iny (O)CM (I)nstallation. It is a simple
application framework on top of the Open Component Model, that can
be used to describe image based installation executors and installation
packages (see topic [ocm toi bootstrapping](ocm_toi_bootstrapping.md) in form of resources
packages (see topic [ocm toi-bootstrapping](ocm_toi-bootstrapping.md) in form of resources
with a dedicated type. All involved resources are hereby taken from a component
version of the Open Component Model, which supports all the OCM features, like
transportation.

The framework consists of a generic bootstrap command
([ocm toi bootstrap componentversions](ocm_toi_bootstrap_componentversions.md)) and an arbitrary set of image
([ocm bootstrap package](ocm_bootstrap_package.md)) and an arbitrary set of image
based executors, that are executed in containers and fed with the required
installation data by th generic command.

Expand All @@ -47,11 +47,11 @@ installation data by th generic command.

##### Additional Help Topics

* [ocm toi <b>bootstrapping</b>](ocm_toi_bootstrapping.md) &mdash; Tiny OCM Installer based on component versions
* [ocm toi <b>ocm-references</b>](ocm_toi_ocm-references.md) &mdash; notation for OCM references
* [ocm toi-bootstrapping](ocm_toi-bootstrapping.md) &mdash; Tiny OCM Installer based on component versions
* [ocm <b>ocm-references</b>](ocm_ocm-references.md) &mdash; notation for OCM references


##### Additional Links

* [<b>ocm toi bootstrap componentversions</b>](ocm_toi_bootstrap_componentversions.md)
* [<b>ocm bootstrap package</b>](ocm_bootstrap_package.md) &mdash; bootstrap component version

Loading