Making Custom Auto completion mechanism for Pig

One handy feature of pig’s Grunt shell is completion mechanism, which will try to complete

Pig Latin keywords and functions when you press the Tab key. For example, consider

the following incomplete line:

grunt> a = foreach b ge

If you press the Tab key at this point, ge will expand to generate, a Pig Latin keyword:

grunt> a = foreach b generate

We can customize the completion tokens by putting our necessary tokens in a file named autocomplete and put it in the pig class path or in the directory where we are invoking the grunt shell

For example: I created a file named autocomplete which contains the tokens







Then after saving this if u press the corresponding alphabet and press tab, it will display the choices for autocompletion.

Note: The tokens that I mentioned above is not related to pig commands or funtions. It is just for an example only. Like this you can create your own custom scripts or tokens for making the scripting handy

About amalgjose
I am an Electrical Engineer by qualification, now I am working as a Software Architect. I am very much interested in Electrical, Electronics, Mechanical and now in Software fields. I like exploring things in these fields. I love travelling, long drives and music.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: