Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
408 stars 197 forks source link

[Issue] Running `azd completion <shell> --help` does not print help related to installing shell completions #2846

Open agpt8 opened 1 year ago

agpt8 commented 1 year ago

Output from azd version azd version 1.4.1 (commit 1cbed85cf47ed235b5ed31868eda79619525bfcc)

Describe the bug Under the shell completion section of the README, it says to get instructions for specific shell, run azd completion <shell> --help (substituting actual name here as the output is same for each shell).

However, instead of printing specific instructions for installing completions for each shell, the generic help (which can also be viewed with azd --help is printed.

To Reproduce

  1. Open terminal with a shell of your choice
  2. Ensure azd is installed.
  3. Run azd --help and see the output.
  4. Now run azd completion <your shell name> --help and see the output.

Expected behavior The output of the command azd completion <your shell name> --help should provide specific instruction to install completion for that shell and not print the generic help which is the same output as azd --help.

Environment Information on your environment:

Update: Also reproducible on Win 11 Beta, build 22631.2338. Powershell: Name Value
PSVersion 7.3.7
PSEdition Core
GitCommitId 7.3.7
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Additional context This issue is encountered on a fresh install of azd and the system itself. Login process has not been initiated yet, though I don't think it should affect it in anyway. Update: The output is the same as stated above after login

agpt8 commented 11 months ago

Any updates on this? I can still reproduce this issue on azd version 1.5.0 (commit 012ae734904e0c376ce5074605a6d0d3f05789ee)

vhvb1989 commented 11 months ago

Hello @agpt8, thank you for reporting this issue. We'll plan for a fix soon (latest features for 1.5.0 have kept us busy :)

Have you used azd completions before? I'd like to understand what's the common use-case. Would you expect to generate completion after each azd-release to update your shell?

agpt8 commented 11 months ago

I have used azd completions for powershell and bash. While I knew how to add those completions to my powershell profiles file, wanted to know if azd recommends some other way to do that or if it had any other mechanims to provide the completions for that shell. Which is why I used the azd completion <shell> --help hoping that it would provide instructions on how to use those completions or atleast some helpful info.

But the command outputs generic help content instead of contents on completions. I would like it to show me what all completions azd offers, how to add them to my shell profile, how to use those completions and any other helpful content that might come in handy with it.