feat(cli): Enhance CLI functionality and add administrator mode support (#13539)

### What problem does this PR solve?

feat(cli): Enhance CLI functionality and add administrator mode support

- Modify `parseActivateUser` in `parser.go` to support 'on'/'off' states
- Add administrator mode switching and host port settings functionality
to `cli.go`
- Implement user management API calls in `client.go`

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
chanx
2026-03-12 13:33:13 +08:00
committed by GitHub
parent 4bd5bb141d
commit 0da9c4618d
3 changed files with 537 additions and 12 deletions

View File

@@ -950,10 +950,11 @@ func (p *Parser) parseActivateUser() (*Command, error) {
}
p.nextToken()
status, err := p.parseIdentifier()
if err != nil {
return nil, err
}
// Accept 'on' or 'off' as identifier
status := p.curToken.Value
if status != "on" && status != "off" {
return nil, fmt.Errorf("expected 'on' or 'off', got %s", p.curToken.Value)
}
cmd := NewCommand("activate_user")
cmd.Params["user_name"] = userName
@@ -962,7 +963,7 @@ func (p *Parser) parseActivateUser() (*Command, error) {
p.nextToken()
if err := p.expectSemicolon(); err != nil {
return nil, err
}
}
return cmd, nil
}