-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daml-assistant: Install bash completion scripts on Linux and Mac. #3946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me but afaict you need to be root for this to actually work and I would like to not encourage that people install the SDK as root. Is there some directory where we can place these files without being root? E.g., place it in ~/.daml
and then source it from ~/.bash_completion
?
This was my first thought, but it doesn't seem too nice if the user removes |
Maybe we can only source it if it exists? Then removing |
Ah, of course! That's a great idea! |
@cocreature I changed it as you suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot!
Awesome, thanks! I would suggest to add a line to the changelog to let users know of this ( It's probably fine to let users find out on their own, but perhaps you may want to add a line somewhere in the docs to make users aware that, if they use |
CHANGELOG_BEGIN - [DAML Assistant] Bash completions for the DAML assistant are now available via ``daml install``. These will be installed automatically on Linux and Mac. If you use bash and have bash completions installed, these bash completions let you use the tab key to autocomplete many DAML Assistant commands, such as ``daml install`` and ``daml version``. CHANGELOG_END
Thanks for the suggestion, will do! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This PR implements bash completion for the daml assistant. Most of this was already available out of the box via optparse-applicative's
--bash-completion-script
command, so this PR is mostly just concerned with installing that script in a standard location, if possible.The command-line completion knows all the commands, and knows all the options for built-in commands (like
daml version
anddaml install
), but it cannot give any information for commands that are distributed with the SDK (likedaml damlc
ordaml sandbox
) because it doesn't know anything about their arguments. But at least the completion still tells you which commands are available.Fixes #3875 for bash at least.