Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- `internal/usage`: drop the action name from `DecodeSpace` /
`DecodeSpaceUsage` / `DecodeTraffic` error strings. The Client
wrappers already prepend `usage: get_space:` / `usage: get_traffic:`
etc., so leaving the action in the decoder produced a doubled prefix
(`usage: get_space: usage: get_space: ReturnInfo[0] is not a Map`).
Decoders now use `"usage: …"` only, matching the established
`account` / `server` pattern.

- `kasapi-cli config init`: rename the local `--profile` flag to
`--name` so it no longer shadows the persistent root `--profile`
flag. Previously `kasapi-cli --profile X config init` silently
Expand Down
6 changes: 3 additions & 3 deletions internal/usage/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func DecodeSpace(returnInfo soap.Value) (SpaceList, error) {
out := make(SpaceList, 0, len(returnInfo.Array))
for i, item := range returnInfo.Array {
if item.Kind != soap.KindMap {
return nil, fmt.Errorf("usage: get_space: ReturnInfo[%d] is not a Map", i)
return nil, fmt.Errorf("usage: ReturnInfo[%d] is not a Map", i)
}
out = append(out, Space{
AccountLogin: getString(item, "account_login"),
Expand All @@ -176,7 +176,7 @@ func DecodeSpaceUsage(returnInfo soap.Value) (SpaceUsageList, error) {
out := make(SpaceUsageList, 0, len(returnInfo.Array))
for i, item := range returnInfo.Array {
if item.Kind != soap.KindMap {
return nil, fmt.Errorf("usage: get_space_usage: ReturnInfo[%d] is not a Map", i)
return nil, fmt.Errorf("usage: ReturnInfo[%d] is not a Map", i)
}
out = append(out, SpaceUsage{
Directory: getString(item, "directory"),
Expand All @@ -200,7 +200,7 @@ func DecodeTraffic(returnInfo soap.Value) (TrafficList, error) {
out := make(TrafficList, 0, len(returnInfo.Map))
for _, kv := range returnInfo.Map {
if kv.Value.Kind != soap.KindMap {
return nil, fmt.Errorf("usage: get_traffic: entry %q is not a Map", kv.Key)
return nil, fmt.Errorf("usage: ReturnInfo entry %q is not a Map", kv.Key)
}
out = append(out, Traffic{
AccountLogin: getString(kv.Value, "account_login"),
Expand Down
Loading