mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 17:05:43 +03:00
Merge pull request #765 from hashicorp/f-fs-cli
Display fs in nomad help and list the subcommands when called
This commit is contained in:
19
command/fs.go
Normal file
19
command/fs.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package command
|
||||
|
||||
import "github.com/mitchellh/cli"
|
||||
|
||||
type FSCommand struct {
|
||||
Meta
|
||||
}
|
||||
|
||||
func (f *FSCommand) Help() string {
|
||||
return "This command is accessed by using one of the subcommands below."
|
||||
}
|
||||
|
||||
func (f *FSCommand) Synopsis() string {
|
||||
return "Inspect the contents of an allocation directory"
|
||||
}
|
||||
|
||||
func (f *FSCommand) Run(args []string) int {
|
||||
return cli.RunResultHelp
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func (f *FSCatCommand) Help() string {
|
||||
}
|
||||
|
||||
func (f *FSCatCommand) Synopsis() string {
|
||||
return "displays a file at a given location"
|
||||
return "Cat a file in an allocation directory"
|
||||
}
|
||||
|
||||
func (f *FSCatCommand) Run(args []string) int {
|
||||
|
||||
@@ -28,7 +28,7 @@ Usage: nomad fs ls <alloc-id> <path>
|
||||
}
|
||||
|
||||
func (f *FSListCommand) Synopsis() string {
|
||||
return "Lists list of files of an allocation directory"
|
||||
return "List files in an allocation directory"
|
||||
}
|
||||
|
||||
func (f *FSListCommand) Run(args []string) int {
|
||||
|
||||
@@ -27,7 +27,7 @@ Usage: nomad fs stat <alloc-id> <path>
|
||||
}
|
||||
|
||||
func (f *FSStatCommand) Synopsis() string {
|
||||
return "Stats an entry in an allocation directory"
|
||||
return "Stat an entry in an allocation directory"
|
||||
}
|
||||
|
||||
func (f *FSStatCommand) Run(args []string) int {
|
||||
|
||||
@@ -57,6 +57,11 @@ func Commands(metaPtr *command.Meta) map[string]cli.CommandFactory {
|
||||
Meta: meta,
|
||||
}, nil
|
||||
},
|
||||
"fs": func() (cli.Command, error) {
|
||||
return &command.FSCommand{
|
||||
Meta: meta,
|
||||
}, nil
|
||||
},
|
||||
"fs ls": func() (cli.Command, error) {
|
||||
return &command.FSListCommand{
|
||||
Meta: meta,
|
||||
|
||||
Reference in New Issue
Block a user