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:
@@ -39,6 +39,11 @@ func (c *commandFsRm) HasTag(CommandTag) bool {
|
||||
}
|
||||
|
||||
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
|
||||
|
||||
if handleHelpRequest(c, args, writer) {
|
||||
return nil
|
||||
}
|
||||
|
||||
isRecursive := false
|
||||
ignoreRecursiveError := false
|
||||
var entries []string
|
||||
|
||||
Reference in New Issue
Block a user