About me
x
Jonhnny Weslley

About The Author

My name is Jonhnny Weslley. At the time of writing I’m twenty-three. I’ve lived in Campina Grande, Brazil, since 2008. Previously, I lived for most of my life in Caxias, Brazil.

Research

I am M.Sc. candidate in the Federal University of Campina Grande, Brazil, working as research assistant with Francisco Brasileiro in the Distributed Systems Laboratory. My current research concentrates on the design and implementation of the distributed file system BeeFS which focuses on the specific setting of corporate desktop networks, while remaining flexible to add easily new machines to a running system. Previously, I have focused on challenges in implementation of Nodewiz's improvements. Nodewiz is a scalable peer-to-peer and fault-tolerant resource and service discovery for overlay networks and grids that supports multi-attribute and range queries.

My research interests include parallel programming, MapReduce, distributed data storage and distributed file systems.

Feel free to contact me.

(or press ESC or click the overlay)

Guide to Scala Bazaar auto completion using BASH

Friday, August 22, 2008

The Scala Bazaar system, "sbaz" in short, is a system used by Scala enthusiasts to share computer files with each other. In particular, it makes it easy to share libraries and applications. In this post, I'll show you how easy it to use one of the nicest facilities of the modern shell, the built in "completion" support, to become more easy to use sbaz in command line.

First you must go to the following site to install the BASH programmable auto completion setup if your distro doesn't have it by default. I don't think many do so you'll need to go to the Programmable Completion Website.

Once you've setup your system for auto completion you need to take the following:

#!/bin/bash

_sbaz_complete()
{
  local cur commands

  COMPREPLY=()
  cur=${COMP_WORDS[COMP_CWORD]}

  commands='available compact help install installed keycreate keyforget 
keyknown keyremember keyremoteknown keyrevoke pack remove retract setuniverse
setup share show showuniverse update packages upgrade'
  cur=`echo $cur | sed 's/\\\\//g'`

  COMPREPLY=($(compgen -W "${commands}" ${cur} | sed 's/\\\\//g') )

}

complete -F _sbaz_complete -o filenames sbaz

And place it in /etc/bash_completion.d/sbaz. Once you've done that the next time you start up your BASH shell you will have sbaz auto completion!

Download snippet code here.

0 comments:

Post a Comment

Newer Post Older Post Home