fig icon indicating copy to clipboard operation
fig copied to clipboard

[aws] Loadspec doesn't show autocomplete results when nested by 2 levels

Open abhishekkh opened this issue 4 years ago • 4 comments

I have a master CLI which wraps around all the CLIs like terraform, kubectl and aws using loadspec. I have had no issues with tf and k8s, but for aws since we have another level of nesting with loadspecs I am not seeing any autocomplete options.

mycli -- terraform plan works mycli -- aws s3 does not

Had a quick chat with @mschrage and he was able to reproduce it. Here is my spec for reference

const completionSpec: Fig.Spec = {
  name: "my",
  description: "My CLI",
  subcommands: [
    {
      name: "kube",
      description: "Wrapper for kubectl CLI",
      subcommands: [
        {
          name: "--",
          description: "Kubectl command",
          loadSpec: "kubectl",
        },
      ],
    },
    {
      name: "aws",
      description: "Wrapper for aws CLI",
      subcommands: [
        {
          name: "--",
          description: "Aws command",
          loadSpec: "aws",
        },
      ],
    },
    {
      name: "terraform",
      description: "Wrapper for terraform CLI",
      subcommands: [
        {
          name: "--",
          description: "Terraform command",
          loadSpec: "terraform",
        },
      ],
    },
  ],
};

export default completionSpec;

abhishekkh avatar Jan 29 '22 03:01 abhishekkh

Thanks for reporting this @abhishekkh!

@fedeci can you look into what's going on here? My initial thought was that it had something to do with the "--" naming. However, I tried renaming the subcommand and could still reproduce.

Screen Shot 2022-01-28 at 8 03 23 PM

The spec was successfully loaded. The error seems to be "Cannot consume subcommand arg."

mschrage avatar Jan 29 '22 04:01 mschrage

This will be fixed with the next AE version!

fedeci avatar Feb 23 '22 19:02 fedeci

This will be fixed with the next AE version!

Is this out yet? @fedeci Thanks for fixing it

abhishekkh avatar Mar 17 '22 17:03 abhishekkh

It is!

fedeci avatar Mar 17 '22 17:03 fedeci