aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_du.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-10-24 20:21:35 -0700
committerGitHub <noreply@github.com>2025-10-24 20:21:35 -0700
commit37af41fbfeaf2e9830e25b658b8bed409fa6fae6 (patch)
tree4ac4d610f83ab3279072593d2d143e1c8a89ba28 /weed/shell/command_fs_du.go
parent922bb171944190dc8a7c9a563cd95da39d9c2ebb (diff)
downloadseaweedfs-37af41fbfeaf2e9830e25b658b8bed409fa6fae6.tar.xz
seaweedfs-37af41fbfeaf2e9830e25b658b8bed409fa6fae6.zip
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
Diffstat (limited to 'weed/shell/command_fs_du.go')
-rw-r--r--weed/shell/command_fs_du.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index 456f6bab6..b94869268 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -36,6 +36,10 @@ func (c *commandFsDu) HasTag(CommandTag) bool {
func (c *commandFsDu) 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