Skip to content
Snippets Groups Projects
Verified Commit affbe8db authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: print support exitcode #17

parent abd140ed
Branches
Tags
No related merge requests found
Showing
with 220 additions and 218 deletions
......@@ -33,7 +33,6 @@
//
// - The trailer records 20-byte SHA1 checksum of all of the above.
//
//
// Source:
// https://www.kernel.org/pub/software/scm/git/docs/v1.7.5/technical/pack-protocol.txt
package packfile
......@@ -48,6 +48,7 @@ func NewReferenceUpdateRequest() *ReferenceUpdateRequest {
// - ofs-delta
// - ref-delta
// - delete-refs
//
// It leaves up to the user to add the following capabilities later:
// - atomic
// - ofs-delta
......
......@@ -83,7 +83,6 @@ func ReadUntilFromBufioReader(r *bufio.Reader, delim byte) ([]byte, error) {
// dheader[pos] = ofs & 127;
// while (ofs >>= 7)
// dheader[--pos] = 128 | (--ofs & 127);
//
func ReadVariableWidthInt(r io.Reader) (int64, error) {
var c byte
if err := Read(r, &c); err != nil {
......
......@@ -42,6 +42,7 @@ func New(n noder.Noder) (*Frame, error) {
// separated by comas.
//
// Examples:
//
// []
// ["a", "b"]
func (f *Frame) String() string {
......
......@@ -26,7 +26,6 @@ import (
// / \ d/b
// b a z
//
//
// This iterator is somewhat especial as you can chose to skip whole
// "directories" when iterating:
//
......
//go:build darwin || freebsd || netbsd
// +build darwin freebsd netbsd
package git
......
//go:build js
// +build js
package git
......
//go:build linux
// +build linux
package git
......
//go:build openbsd || dragonfly || solaris
// +build openbsd dragonfly solaris
package git
......
//go:build windows
// +build windows
package git
......
go-flags: a go library for parsing command line arguments
=========================================================
# go-flags: a go library for parsing command line arguments
[![GoDoc](https://godoc.org/github.com/jessevdk/go-flags?status.png)](https://godoc.org/github.com/jessevdk/go-flags) [![Build Status](https://travis-ci.org/jessevdk/go-flags.svg?branch=master)](https://travis-ci.org/jessevdk/go-flags) [![Coverage Status](https://img.shields.io/coveralls/jessevdk/go-flags.svg)](https://coveralls.io/r/jessevdk/go-flags?branch=master)
......@@ -13,21 +12,22 @@ but provides more options and uses reflection to provide a convenient and
succinct way of specifying command line options.
Supported features:
* Options with short names (-v)
* Options with long names (--verbose)
* Options with and without arguments (bool v.s. other type)
* Options with optional arguments and default values
* Multiple option groups each containing a set of options
* Generate and print well-formatted help message
* Passing remaining command line arguments after -- (optional)
* Ignoring unknown command line options (optional)
* Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification
* Supports multiple short options -aux
* Supports all primitive go types (string, int{8..64}, uint{8..64}, float)
* Supports same option multiple times (can store in slice or last option counts)
* Supports maps
* Supports function callbacks
* Supports namespaces for (nested) option groups
- Options with short names (-v)
- Options with long names (--verbose)
- Options with and without arguments (bool v.s. other type)
- Options with optional arguments and default values
- Multiple option groups each containing a set of options
- Generate and print well-formatted help message
- Passing remaining command line arguments after -- (optional)
- Ignoring unknown command line options (optional)
- Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification
- Supports multiple short options -aux
- Supports all primitive go types (string, int{8..64}, uint{8..64}, float)
- Supports same option multiple times (can store in slice or last option counts)
- Supports maps
- Supports function callbacks
- Supports namespaces for (nested) option groups
The flags package uses structs, reflection and struct field tags
to allow users to specify command line options. This results in very simple
......@@ -44,8 +44,8 @@ When either -v or --verbose is found on the command line, a 'true' value
will be appended to the Verbose field. e.g. when specifying -vvv, the
resulting value of Verbose will be {[true, true, true]}.
Example:
--------
## Example:
```go
var opts struct {
// Slice of bool will append 'true' each time the option
......
......@@ -8,8 +8,7 @@ The flags package is similar in functionality to the go built-in flag package
but provides more options and uses reflection to provide a convenient and
succinct way of specifying command line options.
Supported features
# Supported features
The following features are supported in go-flags:
......@@ -31,6 +30,7 @@ The following features are supported in go-flags:
Supports namespaces for (nested) option groups
Additional features specific to Windows:
Options with short names (/v)
Options with long names (/verbose)
Windows-style options with arguments use a colon as the delimiter
......@@ -38,8 +38,7 @@ Additional features specific to Windows:
Windows style options can be disabled at build time using the "forceposix"
build tag
Basic usage
# Basic usage
The flags package uses structs, reflection and struct field tags
to allow users to specify command line options. This results in very simple
......@@ -71,8 +70,7 @@ Finally, for full control over the conversion between command line argument
values and options, user defined types can choose to implement the Marshaler
and Unmarshaler interfaces.
Available field tags
# Available field tags
The following is a list of tags for struct fields supported by go-flags:
......@@ -159,8 +157,7 @@ The following is a list of tags for struct fields supported by go-flags:
Either the `short:` tag or the `long:` must be specified to make the field eligible as an
option.
Option groups
# Option groups
Option groups are a simple way to semantically separate your options. All
options in a particular group are shown together in the help under the name
......@@ -174,9 +171,7 @@ There are currently three ways to specify option groups.
3. Add a struct field to the top-level options annotated with the
group:"group-name" tag.
Commands
# Commands
The flags package also has basic support for commands. Commands are often
used in monolithic applications that support various commands or actions.
......@@ -211,8 +206,7 @@ However, if the -v flag is defined on the add command, then the first of
the two examples above would fail since the -v flag is not defined before
the add command.
Completion
# Completion
go-flags has builtin support to provide bash completion of flags, commands
and argument values. To use completion, the binary which uses go-flags
......
//go:build !windows || forceposix
// +build !windows forceposix
package flags
......
//go:build !forceposix
// +build !forceposix
package flags
......
//go:build !windows && !plan9 && !appengine && !wasm
// +build !windows,!plan9,!appengine,!wasm
package flags
......
//go:build plan9 || appengine || wasm
// +build plan9 appengine wasm
package flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment