autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

MobiledgeX mcctl

Open pgale61 opened this issue 4 years ago • 3 comments

Sanity checks

  • [X] My issue relates to a specific CLI completion spec (e.g. git checkout is missing options in git completion spec). If your issue is more general, please create your issue here: withfig/fig
  • [X] I have searched github.com/withfig/autocomplete/issues and there are no duplicates of my issue
  • [X] I would like to work on this.

What CLI tool does this relate to?

mcctl

Which statement makes the most sense?

This completion spec does not exist

Issue Details

Our CLI is in the general format command subcommand option=value I'm struggling to get suggestions to work for the value. Seems to work fine if it is --option=value but not without the dashes. Example option

region: {
    name: "region",
    description:
      "Region name",
    requiresEquals: true,
    args: {
      name: "region",
      suggestions: [
        "EU",
        "JP",
        "US",
      ],
    }
  }

Also, I have a bunch of non-hyphen options. After typing command sub-command I am presented with all the options. I pick one, add the "=" and a value, hit space and there is no autocomplete list presented. It's as if it thinks I'm done with options.

pgale61 avatar Nov 22 '21 16:11 pgale61

Related: withfig/fig#638

This can be worked around with generators, but I think it's worth waiting until this is natively supported.

(Previously I'd given an example of a generator here, but it didn't work)

clo4 avatar Dec 23 '21 10:12 clo4

With https://github.com/withfig/fig/issues/638 closed this should work out of the box. I've just tested your example option in a spec locally and it seems to be working as expected

sullivan-sean avatar Jan 13 '22 00:01 sullivan-sean

CleanShot 2022-01-19 at 18 44 54@2x

brendanfalk avatar Jan 20 '22 02:01 brendanfalk

Fwiw, this is fixed now!

clo4 avatar Oct 13 '22 07:10 clo4