Skip to content
Permalink
Browse files

first commit

  • Loading branch information...
celicoo committed Mar 11, 2019
0 parents commit 3c626e8c2de7307cf4227b566e4af16a84897dc6
@@ -0,0 +1,35 @@
<!--
1. Please check if an issue already exists. This bug may have already been documented
2. Fill out the whole template so we have a good overview of the issue
3. Do not remove any section of the template. If something is not applicable leave it empty
4. Please follow the template, otherwise, we'll have to ask you to update it
-->

## Description
<!---
Provide a more detailed introduction to the issue itself, and why you consider
it to be a bug.
-->

## Expected behavior

<!--
If you're describing a bug, tell us what should happen. If you're suggesting a
change/improvement, tell us how it should work.
-->

## Actual behavior
<!--
If describing a bug, tell us what happens instead of the expected behavior.
If suggesting a change/improvement, explain the difference from current behavior.
-->

## Possible Fix
<!---
Not obligatory, but suggest a fix or reason for the bug.
-->

## Your environment

* Version used:
* Link to your project:
@@ -0,0 +1,13 @@
<!---
Please provide a description above and review the requirements below.
-->

## Checklist:
<!---
Go over all the following points, and put an `x` in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help.
-->
- [ ] I have added tests to cover my changes
- [ ] All new and existing tests passed
- [ ] My change requires a change to the documentation
- [ ] I have updated the documentation accordingly
@@ -0,0 +1,12 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
@@ -0,0 +1,3 @@
[submodule "docs/themes/book"]
path = docs/themes/book
url = https://github.com/alex-shpak/hugo-book
@@ -0,0 +1,22 @@
# Travis CI (http://travis-ci.org/) is a continuous integration
# service for open source projects. This file configures it
# to run unit tests for docli.

language: go

go:
- 1.9
- 1.11

matrix:
fast_finish: true

before_install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls

install:
- go get -d -v ./... && go build -v ./...

script:
- go test -v ./...
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at marcelo.franco.alves@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
21 LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,20 @@
<div align="center">
<h1>Docli</h1>
<img alt="Docli" src="https://i.imgur.com/Z1GkZxR.png" width="450">
<p>
<a href="https://travis-ci.org/celicoo/docli">
<img alt="Build Status" src="https://travis-ci.org/celicoo/docli.svg?branch=master">
</a>
<a href="https://godoc.org/github.com/celicoo/docli">
<img alt="GoDoc" src="https://godoc.org/github.com/celicoo/docli?status.svg">
</a>
</p>
</div>

Docli is a simple declarative language for describing command-line interfaces. It cuts down the boilerplate to the very minimum, so you can move on to the reason why you're making the app in the first place.

Docli is 100% inspired on [docopt](https://github.com/docopt/docopt.go).

- [Documentation](https://docli.dev)
- [Tutorial](https://docli.dev/docs/tutorial)
- [Bug tracker](https://github.com/celicoo/docli/issues)
@@ -0,0 +1,16 @@
package docli

import (
"github.com/celicoo/docli/pkg/args"
"github.com/celicoo/docli/pkg/text"
)

// Parse parses the command-line arguments based on the interface described in
// doc string.
func Parse(doc string) (args.Args, error) {
t, err := text.Parse(doc)
if err != nil {
return args.Args{}, err
}
return args.Parse(t)
}
@@ -0,0 +1,18 @@
baseURL: https://docli.dev
languageCode: en-us
title: Docli
googleAnalytics: UA-135349489-1
theme: book
enableGitInfo: true
enableEmoji: true
disableKinds:
- taxonomy
- taxonomyTerm

params:
bookMenuBundle: /menu
bookRepo: https://github.com/celicoo/docli
bookEditPath: edit/master/docs/content
# TODO(celicoo): change this.
# bookMenuBundleActiveLinkColor: \#004ed0
logo: /avatar.png
@@ -0,0 +1,40 @@
---
title: Introduction
type: docs
---

# Introduction

[![Build Status](https://travis-ci.org/celicoo/docli.svg?branch=master)](https://travis-ci.org/celicoo/docli)
[![GoDoc](https://godoc.org/github.com/celicoo/docli?status.svg)](https://godoc.org/github.com/celicoo/docli)

Welcome to the official Docli documentation. This documentation will teach you how to use Docli on your next project.

## Organization

On the left side is a table of contents, organized into sections of related topics. Each topic will help you to understand a bit more about Docli.

**We recommend going through all the sections in a top-down approach.**

## Assumptions

To make the most out of the documentation you should have a working knowledge of:

- [Errors](https://gobyexample.com/errors)
- [Pointers](https://gobyexample.com/pointers)
- [Structs](https://gobyexample.com/structs)

## Reporting a problem

Typos, missing words, and code samples with errors are all considered documentation bugs. If you spot one of them or want to otherwise improve the existing guides, we are happy to help you help us!

Some of the more common ways to report a problem with the guides are:

- Using the **Edit this page** link on the bottom-right of each topic
- Opening an issue or pull request to [the GitHub repository](https://github.com/celicoo/docli)

Clicking the **Edit this page** link will bring you to GitHub's editor for that topic so you can edit right away, using the Markdown markup language. This is the fastest way to correct a typo, a missing word, or an error in a code sample.

If you wish to make a more significant contribution be sure to check our issue tracker to see if your issue is already being addressed. If you don't find an active issue, open a new one.

Many thanks for choosing Docli :heart:.
@@ -0,0 +1,31 @@
# About

Docli is a Go library for building command-line interfaces. It's developed by [celicoo](https://github.com/celicoo).

## Motivation

I love to write command-line interfaces, but I hate the verbosity envolved - that combined with the lack of maintanance on [docopt](https://github.com/docopt/docopt.go) became my excuse to start Docli.

## How it works

Docli parses the command-line arguments based on the interface described in a doc string:

{{< highlight go >}}
var doc = `
My CLI is cool!

Usage: my-cli [command]

Available Commands:
init initialize the application
help help message

Flags:
-a, --author string author name for copyright attribution
-v, --verbose verbose output
`
{{< /highlight >}}

## Versioning

Docli uses the [Go Modules](https://github.com/golang/go/wiki/Modules) support built into Go 1.11 and follows the [semver specification](http://semver.org).
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,4 @@
---
title: "Examples"
weight: 1
---
Oops, something went wrong.

0 comments on commit 3c626e8

Please sign in to comment.
You can’t perform that action at this time.