mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-28 07:50:44 +01:00
Shell: Added a helper function isHelpRequest() (#7380)
* Added a helper function `isHelpRequest()` * also handles combined short flags like -lh or -hl * Created handleHelpRequest() helper function encapsulates both: Checking for help flags Printing the help message * Limit to reasonable length (2-4 chars total) to avoid matching long options like -verbose
This commit is contained in:
1 parent
922bb17194
commit
37af41fbfe
12 files changed
+87
-7
No files matched your search
@@ -3,11 +3,12 @@ package shell
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"io"
|
||||
"sort"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
)
|
||||
@@ -37,6 +38,10 @@ func (c *commandFsMetaCat) HasTag(CommandTag) bool {
|
||||
|
||||
func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
|
||||
|
||||
if handleHelpRequest(c, args, writer) {
|
||||
return nil
|
||||
}
|
||||
|
||||
path, err := commandEnv.parseUrl(findInputDirectory(args))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user