Bash completion needed for versioned juju commands

Bug #1570657 reported by Martin Packman
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Unassigned
juju-core
Won't Fix
Undecided
Unassigned
1.25
Won't Fix
Undecided
Unassigned
juju-core (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The new juju packaging in xenial includes 'juju-1' and 'juju-2.0' commands that are currently not covered by the bash-completion script.

This means no completion for 1.X is available at all at present, and is otherwise confusing when needing to use the specific version commands.

Revision history for this message
Martin Packman (gz) wrote :

There's a pending pull request for other 2.0 improvements to the bash completion script here:

<https://github.com/juju/juju/pull/5057>

Changed in juju-core:
importance: Undecided → High
milestone: none → 2.0-rc1
status: New → Triaged
tags: added: packaging usability
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta5 → 2.0-rc1
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta6 → 2.0-beta7
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in juju-core (Ubuntu):
status: New → Confirmed
Martin Packman (gz)
tags: added: landscape
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta7 → 2.0-beta8
Martin Packman (gz)
tags: added: bash-completion
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta8 → 2.0-beta9
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta9 → 2.0-beta10
Revision history for this message
JuanJo Ciarlante (jjo) wrote :

See updated https://github.com/juju/juju/pull/5057, in short
it adds below two files to /etc/bash_completion.d/
(sort == load order) ->

juju-2.0 (added)
juju-core (existing from juju1)
juju-version (added)

, so that:

* juju-2.0: completion for `juju-2.0`
, but also plain `juju` (ie self-contained)
* juju-core: overwrites completion for `juju`
* juju-version: overwrites completion for `juju`
, with runtime logic to use v1 xor v2.

Revision history for this message
JuanJo Ciarlante (jjo) wrote :
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta10 → 2.0-beta11
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta11 → 2.0-beta12
Changed in juju-core:
milestone: 2.0-beta12 → 2.0-beta13
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta13 → 2.0-beta14
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta14 → 2.0-beta15
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR mentioned in comment 1 is merged.

Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta15 → none
milestone: none → 2.0-beta15
Changed in juju-core:
status: New → Won't Fix
Revision history for this message
David Coronel (davecore) wrote :

I have the same problem:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

$ dpkg -l | egrep 'juju|bash'
ii bash 4.3-14ubuntu1.1 amd64 GNU Bourne Again SHell
ii bash-completion 1:2.1-4.2ubuntu1.1 all programmable completion for the bash shell
ii command-not-found 0.3ubuntu16.04.2 all Suggest installation of packages in interactive bash sessions
ii juju 2.0~beta15-0ubuntu2.16.04.1 all next generation service orchestration system
ii juju-2.0 2.0~beta15-0ubuntu2.16.04.1 amd64 Juju is devops distilled - client

$ juju <I press tab here to autocomplete> _juju_complete_2_0: command not found

I followed the workaround in https://github.com/juju/juju/pull/5057/files and copied the file juju-2.0 from that URL in my /etc/bash_completion.d/ directory and now it works:

$ juju st <I press tab here to autocomplete>
status status-history storage storage-pools
$ juju status

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.