Skip to content

Commit

Permalink
Merge pull request #17 from dbalan/ready-1.0.0
Browse files Browse the repository at this point in the history
Finishing up for 1.0.0 release.
  • Loading branch information
dbalan committed Mar 27, 2018
2 parents 38fe29c + 2b11cc2 commit 8af9c42
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 38 deletions.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Hacking
0. Pipet uses [dep](https://golang.github.io/dep/) for dependency management.

```bash
# Clone repo
WORKDIR=$GOPATH/src/github.com/dbalan/pipet
git clone git@github.com:dbalan/pipet $WORKDIR
cd $WORKDIR
dep ensure # dep needes to be installed ofcourse
go build
```

1. Pipet is mostly written to suit my workflow, which means it is quite limited.
I would be happy to accept pull requests to improve and change workflows, but
if the changes are big, please open an Issue explaining what and why you want
to change something.
48 changes: 15 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
Pipet is a set of commands to store and retrieve snippets of text. Depends on
[fzf](https://github.com/junegunn/fzf) for search.

## Versioning
This project is still nascent phase and does not follow a consistent versioning
scheme yet. Consider all releases alpha.

## Installation
There are multiple ways to get pipet.
1. As a go package (provided you have a working go setup)
Expand All @@ -20,8 +16,7 @@ go install # installs to $GOPATH/bin
```

2. As a binary release
see: https://github.com/dbalan/pipet/releases

see: https://github.com/dbalan/pipet/releases. On *nix you need to set executable permission (`chmod +x pipet`)

## Configuration
Pipet looks for config file `.pipet.yaml` in the home directory. `pipet init` command can generate a new config.
Expand All @@ -35,53 +30,40 @@ editor_binary: "absolute path to editor you want to use" # default is $EDITOR en
## Usage
[![asciicast](https://asciinema.org/a/MR8G05JXEIVY1AvKDrfKNjIEy.png)](https://asciinema.org/a/MR8G05JXEIVY1AvKDrfKNjIEy)
[![asciicast](https://asciinema.org/a/pDumZGUeirlDHdzieWtNB5riL.png)](https://asciinema.org/a/pDumZGUeirlDHdzieWtNB5riL)
```
Store and sprinkle code snippets

Usage:
pipet [command]

Available Commands:
init Configure pipet
new Creates a new snippet and opens editor to edit content
show Show snippet
delete Remove snippet from storage (this is irreversible!)
edit Edit snippet data
edit edit snippet data
help Help about any command
list List all snippets
init Configure pipet
list list all snippets
new Creates a new snippet and opens editor to edit content
show display the snippet

Flags:
--config string config file (default is $HOME/.pipet.yaml)
-h, --help help for pipet
-t, --toggle Help message for toggle

Use "pipet [command] --help" for more information about a command.
```

## TODO
- [x] finish configure command
- [x] hacking docs
- [x] circleci build
- [x] binary downloads
- [x] make public
- [ ] Ability to search full text, with a flag to search command
- [x] Try to abstract snippet id from operations, one way to do this is to move id's optional for commands and jump to a search interface in case IDs are not specified.
- [ ] Tests, would like more tests.
- [ ] Add an archive flag for delete, the data is not deleted, but is not exposed unless user turns on another flag.
- [ ] Add an archive flag in place of delete (?)

## Hacking
0. Uses [dep](https://golang.github.io/dep/) for dependency management.
```bash
# Clone repo
WORKDIR=$GOPATH/src/github.com/dbalan/pipet
git clone git@github.com:dbalan/pipet $OWORKDIR
cd $WORKDIR
dep ensure # dep needes to be installed ofcourse
go build
```
1. Pipet is mostly written to suit my workflow, which means it is quite limited.
I would be happy to accept pull requests to improve and change workflows, but
please open an Issue explaining what and why you want to change something
before opening a PR.
See CONTRIBUTING.md

## Versioning
Follows [semantic versioning](https://semver.org/spec/v2.0.0.html).

## Thanks
Pipet takes a heavy inspiration from [pet](https://github.com/knqyf263/pet) and other projects.
Expand Down
10 changes: 5 additions & 5 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ import (
"github.com/dbalan/pipet/pipetdata"
)

// console colors
var Red = color.New(color.FgRed).SprintFunc()
var Green = color.New(color.FgGreen).SprintFunc()
var Blue = color.New(color.FgBlue).SprintFunc()

func errorGuard(err error, msg string) {
if err != nil {
fmt.Fprintf(os.Stderr, "%s: %v\n", Red(msg), err)
Expand Down Expand Up @@ -230,8 +235,3 @@ func searchFullSnippet() (sid string, e error) {
}
return sid, err
}

// console colors
var Red = color.New(color.FgRed).SprintFunc()
var Green = color.New(color.FgGreen).SprintFunc()
var Blue = color.New(color.FgBlue).SprintFunc()

0 comments on commit 8af9c42

Please sign in to comment.