mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 20:11:20 +02:00
* Make sure we list names/VM names as required argument in the --help * Introduce "orchard logs vm" command * Make sure each command has a Short field * Future-proof port-forward, ssh and vnc commands To support not only the VM resource.
29 lines
492 B
Go
29 lines
492 B
Go
package context
|
|
|
|
import (
|
|
"github.com/cirruslabs/orchard/internal/config"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newDeleteCommand() *cobra.Command {
|
|
command := &cobra.Command{
|
|
Use: "delete NAME",
|
|
Short: "Delete a context",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: runDelete,
|
|
}
|
|
|
|
return command
|
|
}
|
|
|
|
func runDelete(cmd *cobra.Command, args []string) error {
|
|
name := args[0]
|
|
|
|
configHandle, err := config.NewHandle()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return configHandle.DeleteContext(name)
|
|
}
|