-
Notifications
You must be signed in to change notification settings - Fork 4
/
hellod.go
52 lines (43 loc) · 1.1 KB
/
hellod.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
43
44
45
46
47
48
49
50
51
52
// Copyright © 2015-2016 Platina Systems, Inc. All rights reserved.
// Use of this source code is governed by the GPL-2 license described in the
// LICENSE file.
package hellod
import (
"fmt"
"github.com/platinasystems/goes/cmd"
"github.com/platinasystems/goes/lang"
)
const (
Name = "hellod"
Apropos = "test daemon info log"
Usage = "hellod [MESSAGE]..."
Man = `
DESCRIPTION
Print the given or default message to klog or syslog.`
)
var (
apropos = lang.Alt{
lang.EnUS: Apropos,
}
man = lang.Alt{
lang.EnUS: Man,
}
)
func New() Command { return Command{} }
type Command struct{}
func (Command) Apropos() lang.Alt { return apropos }
func (Command) Man() lang.Alt { return man }
func (Command) Kind() cmd.Kind { return cmd.Daemon }
func (Command) String() string { return Name }
func (Command) Usage() string { return Usage }
func (Command) Main(args ...string) error {
iargs := []interface{}{"hello", "world"}
if len(args) > 0 {
iargs = make([]interface{}, 0, len(args))
for _, arg := range args {
iargs = append(iargs, arg)
}
}
fmt.Println(iargs...)
return nil
}