Skip to content

Commit

Permalink
CLI: sort top-level commands
Browse files Browse the repository at this point in the history
* ais <tab>

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Jan 28, 2025
1 parent dcd1175 commit 20a119e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ AIS [consistently shows balanced I/O distribution and linear scalability](https:

For easy usage, management, and monitoring, there's also:
* **Integrated easy-to-use [CLI](/docs/cli.md)**, with top-level commands including:

```console
$ ais <TAB-TAB>

bucket job storage remote-cluster download create wait
object auth archive alias get evict cp
cluster show log rmo dsort stop ls
config help tls space-cleanup put scrub prefetch
etl advanced performance blob-download rmb start search
advanced cluster etl ls rmb stop
alias config evict object rmo storage
archive cp get performance scrub tls
auth create help prefetch show wait
blob-download download job put space-cleanup search
bucket dsort log remote-cluster start
```

AIS runs natively on Kubernetes and features open format - thus, the freedom to copy or move your data from AIS at any time using the familiar Linux `tar(1)`, `scp(1)`, `rsync(1)` and similar.
Expand Down
7 changes: 7 additions & 0 deletions cmd/cli/cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -330,6 +331,12 @@ func (a *acli) setupCommands(emptyCmdline bool) {
}

app.Commands = append(app.Commands, a.initAliases()...)

// alphabetically
sort.Slice(app.Commands, func(i, j int) bool {
return app.Commands[i].Name < app.Commands[j].Name
})

setupCommandHelp(app.Commands)
a.enableSearch()
}
Expand Down
11 changes: 6 additions & 5 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ The recommended and, actually, fastest way to get started with CLI is to type `a
```console
$ ais <TAB-TAB>

bucket job storage remote-cluster download create wait
object auth archive alias get evict cp
cluster show log rmo dsort stop ls
config help tls space-cleanup put scrub prefetch
etl advanced performance blob-download rmb start search
advanced cluster etl ls rmb stop
alias config evict object rmo storage
archive cp get performance scrub tls
auth create help prefetch show wait
blob-download download job put space-cleanup search
bucket dsort log remote-cluster start
```

These are the current set of top-level commands. Each command has its own extended help (the `--help` option) and, usually, multiple sub-commands
Expand Down
13 changes: 8 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ AIS [consistently shows balanced I/O distribution and linear scalability](https:

For easy usage, management, and monitoring, there's also:
* **Integrated easy-to-use [CLI](/docs/cli.md)**, with top-level commands including:


```console
$ ais <TAB-TAB>

bucket job storage remote-cluster download create wait
object auth archive alias get evict cp
cluster show log rmo dsort stop ls
config help tls space-cleanup put scrub prefetch
etl advanced performance blob-download rmb start search
advanced cluster etl ls rmb stop
alias config evict object rmo storage
archive cp get performance scrub tls
auth create help prefetch show wait
blob-download download job put space-cleanup search
bucket dsort log remote-cluster start
```

AIS runs natively on Kubernetes and features open format - thus, the freedom to copy or move your data from AIS at any time using the familiar Linux `tar(1)`, `scp(1)`, `rsync(1)` and similar.
Expand Down

0 comments on commit 20a119e

Please sign in to comment.