Implement 'delete' command for interface removal and refactor 'add' command
This commit is contained in:
25
cmd/delete.go
Normal file
25
cmd/delete.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright © 2026 Masato Kikuchi <m-kikuchi@neody.ad.jp>
|
||||
*/
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"git.neody.ad.jp/tuna2134/etherip-client/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var DelDevVar string
|
||||
|
||||
var deleteCmd = &cobra.Command{
|
||||
Use: "delete",
|
||||
Short: "Delete iface",
|
||||
Long: `Delete iface`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return utils.DelDev(DelDevVar)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
deleteCmd.Flags().StringVarP(&DelDevVar, "devname", "d", "eip0", "削除対象のNICの名前")
|
||||
rootCmd.AddCommand(deleteCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user