- Implements all placeholder Go examples in the `examples` directory. - Corrects the `run_matrix_programmatically` example to use the `borg` package. - Refactors the code to centralize the matrix execution logic in the `matrix` package. - Updates the documentation to include a new "Programmatic Usage" section that describes all of the Go examples. - Updates the "Terminal Isolation Matrix" section to remove manual 'runc' instructions, emphasizing that 'borg run' handles this process to maintain security and isolation. - Adds missing examples for 'collect github repos', 'collect github release', and 'compile' commands to the documentation.
27 lines
474 B
Go
27 lines
474 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/Snider/Borg/pkg/matrix"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var runCmd = NewRunCmd()
|
|
|
|
func NewRunCmd() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "run [matrix file]",
|
|
Short: "Run a Terminal Isolation Matrix.",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return matrix.Run(args[0])
|
|
},
|
|
}
|
|
}
|
|
|
|
func GetRunCmd() *cobra.Command {
|
|
return runCmd
|
|
}
|
|
|
|
func init() {
|
|
RootCmd.AddCommand(GetRunCmd())
|
|
}
|