Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add harakeishi as a contributor for code #2

Merged
merged 3 commits into from Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions .all-contributorsrc
@@ -0,0 +1,24 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "harakeishi",
"name": "原 慧士",
"avatar_url": "https://avatars.githubusercontent.com/u/44335168?v=4",
"profile": "https://yaserarenai.com",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "curver",
"projectOwner": "harakeishi",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
42 changes: 33 additions & 9 deletions README.md
@@ -1,10 +1,13 @@
![logo](logo.png)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
[![GitHub release](https://img.shields.io/github/release/harakeishi/curver.svg)](https://github.com/harakeishi/curver/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/harakeishi/curver)](https://goreportcard.com/report/github.com/harakeishi/curver)

`curver` is a simple way to display the version of a CUI tool made with go.
`curver` was named as an abbreviation for `current version`.

## Table of Contents
### Table of Contents
- [Installation](#installation)
- [Importing](#importing)
- [Documentation](#documentation)
Expand All @@ -13,27 +16,28 @@
- [use goreleaser](#use-goreleaser)
- [If you only want the version](#if-you-only-want-the-version)
- [License](#license)
- [Contributors ✨](#contributors-)

# Installation
## Installation
```bash
go get github.com/harakeishi/curver
```

# Importing
## Importing
```go
import (
"github.com/harakeishi/curver"
)
```

# Documentation
## Documentation
Visit the docs on [GoDoc](https://pkg.go.dev/github.com/harakeishi/curver)

# usage
## usage
If the value using ldflag is stored in the variable Version, that value will be displayed.
Otherwise, it will display the build information embedded in the running binary.

## use go build
### use go build
```go
// main.go
package main
Expand Down Expand Up @@ -63,7 +67,7 @@ If you want to embed the result of 'git tag', you can do the following
```
$ go build -ldflags "-X github.com/harakeishi/curver.Version=$(git describe --tags)" -o ./main
```
## use goreleaser
### use goreleaser
If you are using [goreleaser](https://goreleaser.com/) to do the release, do the following

```yml
Expand All @@ -73,7 +77,7 @@ builds:

```

## If you only want the version
### If you only want the version
The following will return the version as a string.

```go
Expand All @@ -89,6 +93,26 @@ func main () {
}
```

# License
## License
Copyright (c) 2022 harakeishi
Licensed under [MIT](LICENSE)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://yaserarenai.com"><img src="https://avatars.githubusercontent.com/u/44335168?v=4?s=100" width="100px;" alt=""/><br /><sub><b>原 慧士</b></sub></a><br /><a href="https://github.com/harakeishi/curver/commits?author=harakeishi" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!