-
Notifications
You must be signed in to change notification settings - Fork 4
/
linux.go
50 lines (39 loc) · 880 Bytes
/
linux.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
// Copyright © 2018 Platina Systems, Inc. All rights reserved.
// Use of this source code is governed by the GPL-2 license described in the
// LICENSE file.
package linux
import (
"fmt"
"github.com/platinasystems/goes/cmd"
"github.com/platinasystems/goes/lang"
)
type Command struct {
Kern string
Cmd []string
}
func (c Command) String() string { return "linux" }
func (c Command) Usage() string {
return "NOP"
}
func (Command) Apropos() lang.Alt {
return lang.Alt{
lang.EnUS: "NOP",
}
}
func (Command) Man() lang.Alt {
return lang.Alt{
lang.EnUS: Man,
}
}
const Man = "Set the kernel and command line"
func (Command) Kind() cmd.Kind { return cmd.DontFork }
func (c *Command) Main(args ...string) error {
if len(args) == 0 {
return fmt.Errorf("%s: missing arguments\n", c)
}
c.Kern = args[0]
if len(args) > 1 {
c.Cmd = args[1:]
}
return nil
}