~srivathsan/note

dc27f872768f3dbb6003fa23ee96b5ec815f1fd2 — Srivathsan Murali 1 year, 7 months ago 279766f
Add subcommand to cat the note
1 files changed, 10 insertions(+), 0 deletions(-)

M src/note
M src/note => src/note +10 -0
@@ 51,6 51,13 @@ cmd_remove() {
  cmd_prune
}

cmd_cat() {
  localpath="$1.md"
  filepath="$NOTES_DIR/$localpath"
  
  cat "$filepath"
}

cmd_list() {
  path=${1:-"."}
  (


@@ 79,6 86,8 @@ cmd_usage() {
	        Remove existing note or directory, optionally forcefully.
	    $PROGRAM mv old-path new-path
	        Renames or moves old-path to new-path.
	    $PROGRAM cat note-name
          Writes the contents of the note into stdout.
	    $PROGRAM git git-command-args...
	        If the notes dir is a git repository, execute a git command
	        specified by git-command-args.


@@ 93,6 102,7 @@ case "$1" in
  ls|list) shift; cmd_list $@;; 
  mv|move) shift; cmd_move $@ ;;
  rm|remove) shift; cmd_remove $@ ;;
  cat) shift; cmd_cat $@ ;;
  git) shift; git_cmd "$@" ;;
  help|*) cmd_usage ;;
esac