tower-cli icon indicating copy to clipboard operation
tower-cli copied to clipboard

Add subcommands alias

Open jordeu opened this issue 4 years ago • 7 comments

Ex:

compute-env -> ce credentials -> creds pipelines -> pipes

jordeu avatar Sep 07 '21 08:09 jordeu

Nice, think even without s

compute-env -> ce
credentials -> cred
pipelines -> pipe

pditommaso avatar Sep 07 '21 08:09 pditommaso

There is a bug at picocli library when generating the autocompletion scripts for the subcommands aliases: https://github.com/remkop/picocli/issues/1388

This will be implemented when this bug is fixed.

jordeu avatar Sep 07 '21 08:09 jordeu

picocli 4.6.2, fixing the issue with subcommand aliases, has been released. https://github.com/remkop/picocli/releases/tag/v4.6.2

jordeu avatar Nov 05 '21 12:11 jordeu

The only difficulty of this issue is to decide which is the best alias. Let me do a proposal and if we agree on it we can add this to 0.5 release.

Main commands:

  • actions ->
  • collaborators ->
  • compute-envs -> ce
  • credentials -> creds
  • info ->
  • launch ->
  • members ->
  • organizations -> orgs
  • participants ->
  • pipelines -> pipes
  • runs ->
  • teams ->
  • workspaces -> ws

Subcommands:

  • list -> l
  • view -> v
  • delete -> d
  • create -> c
  • update -> u
  • export -> e
  • import -> i
  • leave -> (also at commands that have list subcommand)
  • relaunch -> r (only at runs command`)
  • cancel -> c (only at runs command`)

jordeu avatar Nov 09 '21 15:11 jordeu

Think in the shortcut the s can be omitted (apart ws..`) eg.

actions -> action
collaborators -> collab
compute-envs -> ce
credentials -> cred
info -> into 
launch -> launch
members -> member
organizations -> org
participants -> ??
pipelines -> pipe
runs -> run 
teams -> team
workspaces -> ws

pditommaso avatar Nov 09 '21 21:11 pditommaso

Picocli v4.6.2 do not fixed the autocomplete. Still the completion of the subcommands using alias is not working: Screenshot from 2021-11-30 08-48-45

I'm going to label this as "on hold" again. We need to report this to picocli because it seems it is not reported.

jordeu avatar Nov 30 '21 11:11 jordeu

New picocli released: https://github.com/remkop/picocli/releases/tag/v4.6.3

Some improvements on alias autocompletion. We can give it a try again.

jordeu avatar Feb 09 '22 10:02 jordeu