powerwake should support tab completion

Bug #551073 reported by Nobuto Murata
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powernap
Fix Released
Wishlist
Dustin Kirkland 
powernap (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

As wishlist, powerwake should support tab completion in command line.
Users stores Hostname-MAC address corresponding table in /etc/ethers,
and powerwake caches in /var/cache/powerwake/ethers.
powerwake should support Hostname completion from stored/cached entries.

Expected result:
 1. store Hostname-MAC address corresponding table in /etc/ethers.
 2. type "powerwake O" in your shell.
 3. press [TAB].
 4. completed as "powerwake OBJECTIVE_HOST_NAME"

Actual result:
 4. listed files in current directory.

powernap: 1.9-0ubuntu1
Ubuntu 10.04(Lucid)

Related branches

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Great idea. Will take a look at this after Lucid (unless you have a good, working patch now).

Changed in powernap:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Fumihito YOSHIDA (hito) wrote :

Hi Dustin and Nobuto,

I wrote completion, but its hacky.

Nobuto, Could you please test in your cases?

Test procedure are below:
1) install attached "powerwake" file for your /etc/bash_completion.d/

2) exec:
 $ source .bashrc

3) exec:
 $ powerwake (type tab)

Revision history for this message
Nobuto Murata (nobuto) wrote :

Fumihito,
thank you for your script.
Your script works fine.

Based on your script, I made a changes for supporting options completion.
My branch is linked to this page.

Could you also test my branch?

Revision history for this message
Fumihito YOSHIDA (hito) wrote :

Nobuto,

Thank you, your branch works fine, but "-b" completion is not enough.

I added *more* completions in -b/--broadcast pattern, please re-test.
  https://code.launchpad.net/~hito/powernap/bash-completion-support

Revision history for this message
Nobuto Murata (nobuto) wrote :

> "-b" completion is not enough.

I thought bloadcast adress is input by hand, so I left it as blank.
Your idea is great.

Besides you made changes more.
I guess you intend to complete TARGET and OPTIONS at the same time.
But it's not my intended behavior.

For example, could you try the below lines in terminal
$ apt-cache [TAB]
$ apt-cache -[TAB]

That's my intended behavior.
So I didn't merge your branch to mine, but I picked up --broadcast option completion as rev.147.

Revision history for this message
Nobuto Murata (nobuto) wrote :

Dustin,
now implementation is done.
Could you review it and if it's OK, please merge it.

Changed in powernap:
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 551073] Re: powerwake should support tab completion

Yup, thanks a lot, I'll get it merged ;-)

On Thu, Apr 1, 2010 at 12:03 PM, Nobuto MURATA <email address hidden> wrote:
> Dustin,
> now implementation is done.
> Could you review it and if it's OK, please merge it.
>
> ** Changed in: powernap
>     Assignee: (unassigned) => Dustin Kirkland (kirkland)
>
> --
> powerwake should support tab completion
> https://bugs.launchpad.net/bugs/551073
> You received this bug notification because you are a bug assignee.
>

--
:-Dustin

Changed in powernap (Ubuntu):
status: New → In Progress
Changed in powernap:
status: Confirmed → Fix Committed
Changed in powernap (Ubuntu):
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Changed in powernap (Ubuntu):
status: In Progress → Fix Committed
Changed in powernap:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package powernap - 1.10-0ubuntu1

---------------
powernap (1.10-0ubuntu1) maverick; urgency=low

  [ Nobuto MURATA ]
  * debian/powerwake.install, powerwake_completion: add bash completion
    for powerwake, LP: #551073

  [ Dustin Kirkland ]
  * powerwake: create the ~/.cache/ethers file, if it does not already
    exist, LP: #582381
 -- Dustin Kirkland <email address hidden> Thu, 04 Mar 2010 11:04:54 -0600

Changed in powernap (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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