mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 01:08:40 +08:00
weed shell: adjust help text format
This commit is contained in:
parent
6b70b36105
commit
bd1c0735e0
@ -19,7 +19,7 @@ func (c *commandCollectionList) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandCollectionList) Help() string {
|
func (c *commandCollectionList) Help() string {
|
||||||
return "# list all collections"
|
return `list all collections`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||||
|
@ -25,7 +25,12 @@ func (c *commandFsDu) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandFsDu) Help() string {
|
func (c *commandFsDu) Help() string {
|
||||||
return "http://<filer_server>:<port>/dir[/file] # show disk usage"
|
return `show disk usage
|
||||||
|
|
||||||
|
fs.du http://<filer_server>:<port>/dir
|
||||||
|
fs.du http://<filer_server>:<port>/dir/file_name
|
||||||
|
fs.du http://<filer_server>:<port>/dir/file_prefix
|
||||||
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandFsDu) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
func (c *commandFsDu) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||||
|
@ -26,7 +26,12 @@ func (c *commandVolumeFixReplication) Name() string {
|
|||||||
func (c *commandVolumeFixReplication) Help() string {
|
func (c *commandVolumeFixReplication) Help() string {
|
||||||
return `add replicas to volumes that are missing replicas
|
return `add replicas to volumes that are missing replicas
|
||||||
|
|
||||||
-n do not take action
|
This command file all under-replicated volumes, and find volume servers with free slots.
|
||||||
|
If the free slots satisfy the replication requirement, the volume content is copied over and mounted.
|
||||||
|
|
||||||
|
volume.fix.replication -n # do not take action
|
||||||
|
volume.fix.replication # actually copying the volume files and mount the volume
|
||||||
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,11 @@ func (c *commandVolumeList) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandVolumeList) Help() string {
|
func (c *commandVolumeList) Help() string {
|
||||||
return "# list all volumes"
|
return `list all volumes
|
||||||
|
|
||||||
|
This command list all volumes as a tree of dataCenter > rack > dataNode > volume.
|
||||||
|
|
||||||
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||||
|
@ -92,7 +92,8 @@ func printGenericHelp() {
|
|||||||
return strings.Compare(commands[i].Name(), commands[j].Name()) < 0
|
return strings.Compare(commands[i].Name(), commands[j].Name()) < 0
|
||||||
})
|
})
|
||||||
for _, c := range commands {
|
for _, c := range commands {
|
||||||
fmt.Printf("\t%s %s \n", c.Name(), c.Help())
|
helpTexts := strings.SplitN(c.Help(), "\n", 2)
|
||||||
|
fmt.Printf(" %-30s\t# %s \n", c.Name(), helpTexts[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,9 +112,7 @@ func printHelp(cmds []string) {
|
|||||||
|
|
||||||
for _, c := range commands {
|
for _, c := range commands {
|
||||||
if c.Name() == cmd {
|
if c.Name() == cmd {
|
||||||
fmt.Println()
|
fmt.Printf(" %s\t# %s\n", c.Name(), c.Help())
|
||||||
fmt.Printf("\t%s %s \n", c.Name(), c.Help())
|
|
||||||
fmt.Println()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user