[NPMCLI-69] Command to append bash completion to .bash_profile / .bashrc Created: 17/Jan/17  Updated: 16/Feb/17  Resolved: 10/Feb/17

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Improvement Priority: Neutral
Reporter: Robert Kowalski Assignee: Cedric Reichenbach
Resolution: Done Votes: 0
Labels: documentation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing NPMCLI-96 Set up tab autocompletion on installa... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: CLI: Help users get started
Sprint: Basel 82
Story Points: 13

 Description   

The tab completion for commands is super useful.

A command, like mgnl install-completion would be nice.



 Comments   
Comment by Tomáš Gregovský [ 25/Jan/17 ]

why command? why not automatically happens after installation? or maybe as a question during installation [y/n] ?

Comment by Cedric Reichenbach [ 01/Feb/17 ]

Making completion files available from an npm script turns out to be harder than expected due to permission issues. If a user runs installation with `sudo`, npm downgrades permissions of scripts, effectively removing write permissions for any directories/files related to tab completion, even user-specific ones.

It seems that all we can do in such a case is warning the user about what's happening with possible fixes. Should we provide an additional command for setting tab completion up after installation? Permissions are like more predictable there, but it would somewhat scatter the api.

Also, how common is it for people to require sudo right for global installs?

Comment by Cedric Reichenbach [ 07/Feb/17 ]

Automatic installation on npm install has been postponed due to a bug in npm (see linked follow-up issue).

For now, tab-autocomplete (un)installation can be done with mgnl tab-completion (install|uninstall)

Generated at Mon Feb 12 04:46:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.