Skip to content

Commit

Permalink
more path mappings (#877)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:
<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

---------

Co-authored-by: Hilmar Falkenberg <[email protected]>
  • Loading branch information
mandelsoft and hilmarf authored Aug 16, 2024
1 parent 6781abe commit b7bbce4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
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

0 comments on commit b7bbce4

Please sign in to comment.