Home

David Kirwan edited this page Jun 14, 2013 · 4 revisions
Clone this wiki locally

Welcome to the usefuldb-gem wiki!

Usage instructions:

This wiki page will hopefully explain some basic usage instructions for this tool

Running the tool without parameters prints welcome information

dkirwan@archbox:~$ usefuldb -h
UsefulDB - a simple command and URL database (0.0.12)

  Useage:  usefuldb <searchtag1> <searchtag2> .. <searchtagN>

    -a, --add                        Add an entry to the database
    -d, --delete                     Delete an entry from the database
    -l, --list                       List all entries in the database
    -h, --help                       Print out this message

Adding an element to the database

dkirwan@archbox:~$ usefuldb -a
Launching the add system:
in verbose mode
Please enter the comma separated search tags like the following:
eg:
term1, term2, term3

test3, test4, test5 
Please enter the value you wish to store for this database entry:
Some other test value
Please enter a description for this entry: 
some other test description
I, [2012-08-03T14:47:16.290330 #13389]  INFO -- : Storing the following in the database:
I, [2012-08-03T14:47:16.290413 #13389]  INFO -- : Search tags: ["test3", "test4", "test5"]
I, [2012-08-03T14:47:16.290440 #13389]  INFO -- : Entry Value: Some other test value
I, [2012-08-03T14:47:16.290463 #13389]  INFO -- : Description: some other test description
I, [2012-08-03T14:47:16.292488 #13389]  INFO -- : Saving database

Listing out the entries in the database

dkirwan@archbox:~$ usefuldb -l
Launching the list system:
##
Element: 0
- Tags: ["test", "test1", "test2"]
- Value: test value
- Description: test description
##
Element: 1
- Tags: ["test3", "test4", "test5"]
- Value: Some other test value
- Description: some other test description
##
I, [2012-08-03T14:45:17.835073 #13380]  INFO -- : Number of entries in the database is: 2

Deleting an element from the database

dkirwan@archbox:~$ usefuldb -d
Element: 0
- Tags: ["test", "test1", "test2"]
- Value: test value
- Description: test description
##
Element: 1
- Tags: ["test3", "test4", "test5"]
- Value: Some other test value
- Description: some other test description
##
I, [2012-08-03T14:49:35.414565 #13393]  INFO -- : Number of entries in the database is: 2
Enter the number of the element from the list above which you want to delete
1
I, [2012-08-03T14:51:52.098510 #13393]  INFO -- : Entry removed
I, [2012-08-03T14:51:52.100389 #13393]  INFO -- : Saving database

Searching the database for values (Sample output from a populated database)

dkirwan@archbox:~$ usefuldb test install website google git
Launching the search system:

Searching the database for tag: test

Searching the database for tag: install
- Tags: ["install", "rubygems", "website", "usefuldb"]
- Value: http://rubygems.org/usefuldb
- Description: Website for the usefuldb gem
##

Searching the database for tag: website
- Tags: ["install", "rubygems", "website", "usefuldb"]
- Value: http://rubygems.org/usefuldb
- Description: Website for the usefuldb gem
##
- Tags: ["search", "find", "website", "google"]
- Value: http://www.google.com
- Description: Search engine
##

Searching the database for tag: google
- Tags: ["search", "find", "website", "google"]
- Value: http://www.google.com
- Description: Search engine
##

Searching the database for tag: git
- Tags: ["git", "add"]
- Value: git add <path>
- Description: Add files at path to the git branch
##
- Tags: ["git", "commit"]
- Value: git commit -m 'commit message'
- Description: Detail the changes in this commit
##
- Tags: ["git", "rm", "cache"]
- Value: git rm -r --cached
- Description: Delete all files in the directory not managed by git
##
- Tags: ["git", "tag", "tagging"]
- Value: git tag -a v0.0.0 -m 'Version 0.0.0'
- Description: Create a tag for a specific point in the branch history which can be easily accessed later
##