-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ba3470
commit cb7bf3a
Showing
4 changed files
with
48 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,58 +3,81 @@ | |
[![Code Climate](https://codeclimate.com/github/arturoherrero/gvar/badges/gpa.svg)](https://codeclimate.com/github/arturoherrero/gvar) | ||
[![Build Status](https://travis-ci.org/arturoherrero/gvar.svg?branch=master)](https://travis-ci.org/arturoherrero/gvar) | ||
|
||
`gvar` - display, set, or remove global variables. | ||
gvar(1) -- display, set, or remove global variables*. | ||
|
||
<sub>* When I say global variable, I refer to a key-value pair that you can | ||
read/write at any time in any terminal session. You can think this is similar | ||
to the environment variables because it's a set of dynamic-named values but they | ||
are not session-wide or system-wide related.</sub> | ||
|
||
|
||
## Description | ||
|
||
**gvar** is a pure Bash key-value store where each user has a different collection | ||
of data. The records are stored in the user's home directory. | ||
of data. The records are stored in the user's home directory as `~/.gvar` file. | ||
|
||
|
||
## Installation | ||
|
||
1. Clone this repository: | ||
Clone this repository: | ||
|
||
$ git clone [email protected]:arturoherrero/gvar.git | ||
```shell | ||
$ git clone [email protected]:arturoherrero/gvar.git | ||
``` | ||
|
||
2. Add `gvar/bin/` to your `PATH`: | ||
Add `gvar/bin/` to your `PATH`: | ||
|
||
$ echo 'export PATH="${PATH}:path/to/gvar/bin"' >> ~/.bash_profile | ||
```shell | ||
$ echo 'export PATH="${PATH}:path/to/gvar/bin"' >> ~/.bash_profile | ||
``` | ||
|
||
3. Source your profile | ||
Source your profile: | ||
|
||
$ source ~/.bash_profile | ||
```shell | ||
$ source ~/.bash_profile | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
To print out the names and values of all the global variables, use: | ||
|
||
$ gvar | ||
```shell | ||
$ gvar | ||
``` | ||
|
||
To set global variables, use arguments of the form <VARIABLE>=<VALUE>, | ||
setting variable <VARIABLE> to value <VALUE>: | ||
To set global variables, use arguments of the form `<VARIABLE>=<VALUE>`, | ||
setting variable `<VARIABLE>` to value `<VALUE>`: | ||
|
||
$ gvar VARIABLE=VALUE | ||
```shell | ||
$ gvar VARIABLE=VALUE | ||
``` | ||
|
||
Setting a global variable to an empty value is different from unsetting it: | ||
|
||
$ gvar VARIABLE= | ||
```shell | ||
$ gvar VARIABLE= | ||
``` | ||
|
||
To print the value of the global variable <VARIABLE>, use: | ||
To print the value of the global variable `<VARIABLE>`, use: | ||
|
||
$ gvar VARIABLE | ||
```shell | ||
$ gvar VARIABLE | ||
``` | ||
|
||
To remove (unset) a global variable <VARIABLE>, use: | ||
To remove (unset) a global variable `<VARIABLE>`, use: | ||
|
||
$ gvar -u VARIABLE | ||
$ gvar --unset=VARIABLE | ||
```shell | ||
$ gvar -u VARIABLE | ||
$ gvar --unset=VARIABLE | ||
``` | ||
|
||
To delete the environment, removing all the global variables, use: | ||
|
||
$ gvar -d | ||
$ gvar --delete-environment | ||
```shell | ||
$ gvar -d | ||
$ gvar --delete-environment | ||
``` | ||
|
||
|
||
## Who made this? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters