Over a million developers have joined DZone.

Readline for NuoManager

· Database Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

You may already be familiar with a tool called rlwrap. If you aren't, you should check it out. It's a nifty tool. On Unix-like systems, it provides readline functionality for commands that lack it. 

Our nuodbmgr is one such command. If you spend any time managing NuoDB domains in an ad-hoc fashion and you're a fan of the command-line, then you can make your life a little easier and save yourself some keystrokes. First, installrlwrap either with your distribution's package manager, or from the source available at the above link. Next, create a file containing a completion word list:

administrator allowNonDurable apply archive capture categories config create database databases dbFile dbname domain echo graceful help host hostname hosts initialize license licenseFile log manage memory monitor name newHost options password pid process processes property quiesce remove restart set show shutdown sm start status summary targetVersion te trace unquiesce unset user value verify version

Feel free to edit this file however you like, for example, by adding your domain or database name to the list. Now, when you invoke the NuoDB Manager, prefix the command with rlwrap:

rlwrap -r -f ~/.manager-completions nuodbmgr --user domain --password mySecret --broker localhost

The -f option will pre-fill the in-memory completion word list with the words in the supplied file. The -r flag will cause any words that appear as input or output during your nuodbmgr session to be added to the in-memory list for use during that session. One caveat to note is that rlwrap is not context sensitive, so it's perfectly happy to suggest localhost as a NuoDB Manager command (which it is not). Happy hacking!

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


Published at DZone with permission of Seth Proctor, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}