forked from alexellis/arkade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.go
42 lines (31 loc) · 893 Bytes
/
info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) arkade author(s) 2021. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// kasten contains a suite of Sponsored Apps for arkade
package kasten
import (
"fmt"
"github.com/spf13/cobra"
)
func MakeInfo() *cobra.Command {
command := &cobra.Command{
Use: "info",
Short: "Info for an app",
Long: `Info for an app`,
Example: ` arkade kasten info [APP]`,
SilenceUsage: true,
}
command.RunE = func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return fmt.Errorf("give an app as an argument")
}
info := "None found."
if args[0] == "k10" {
info = k10InfoMsg
} else if args[0] == "preflight" {
info = k10preflightInfoMsg
}
fmt.Printf("Info for your app: %s\n\n%s\n\n", args[0], info)
return nil
}
return command
}