diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..74f99fd --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +Nullprompt README +================= + +Nullprompt is a very simple and barely customizable PS1 generator, written for +`nullspoon`. As it was written for one person in mind, it does only what is +wanted by its author. If you want it to do something different, please feel +free to fork (GPLv3 of course), or submit a request for another feature or a +pull request implementing it. Nothing extravagant though please. The purpose +of this is to have a _very_ fast but robust enough PS1 while using reasonable +defaults. Execution time should remain somewhere under 20 milliseconds. + +What does nullprompt do? +------------------------ + +At this time, nullprompt outputs essentially two different modes: normal, and git. + +If you are anywhere on the filesystem that _isn't_ a git repo, you should see a +PS1 that looks something like `retval user@host cwd$ `. The retval is color +coded: success / 0 is green, error / 1 is red, and anything above that is +yellow. + +If you are within a git repo, you should see a PS1 like `retval [branch] +reponame/sub/path$ `. Note that if the sub path is very long, it will be +truncated, with an ellipse in the middle of the path to indicate truncation. + + +Options +------- + +Nullprompt supports one command line option: `-v,--version`. It prints the +version. :) + + +Usage +----- + +To use this, set the following int your `.bashrc` file. + +``` +get_prompt() { + retval=$? + PS1="$(RETVAL=${retval} nullprompt || printf '$ ')" +} + +export PROMPT_COMMAND=get_prompt +``` |