29 lines
450 B
Go
29 lines
450 B
Go
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"github.com/spf13/cobra"
|
||
|
|
||
|
"integralnaya.com/software/posadka/internal"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
rootCmd.AddCommand(writeCmd)
|
||
|
}
|
||
|
|
||
|
var writeCmd = &cobra.Command{
|
||
|
Use: "write",
|
||
|
Short: "Print the write number of Hugo",
|
||
|
Long: `All software has writes. This is Hugo's`,
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
root, err := internal.AmIRoot()
|
||
|
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
if !root {
|
||
|
panic("no root!")
|
||
|
}
|
||
|
},
|
||
|
}
|