• Stars
    star
    10
  • Rank 1,807,489 (Top 36 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A string argument parser that understands quotes and backslashes

GoDoc Codeship Codecov Go Report Card

parseargs-go

This is a port of the parserargs.js project to Go.

What about parsing arguments allowing quotes in them? But beware that this library will not parse flags (-- and -), flags will be returned as simple strings.

Installation

go get -u github.com/txgruppi/parseargs-go

Example

package main

import (
  "fmt"
  "log"

  "github.com/txgruppi/parseargs-go"
)

func main() {
  setInRedis := `set name "Put your name here"`
  parsed, err := parseargs.Parse(setInRedis)
  if err != nil {
    log.Fatal(err)
  }
  fmt.Printf("%#v\n", parsed) // []string{"set", "name", "Put your name here"}
}

Tests

go get -u -t github.com/txgruppi/parseargs-go
cd $GOPATH/src/github.com/txgruppi/parseargs-go
go test ./...

License

MIT

More Repositories

1

json2react

Use JSON to create React Components.
JavaScript
167
star
2

meteor-simple-i18n

Simple I18n support for meteor
JavaScript
20
star
3

uml.js

ABANDONED - JSON to UML (or something like it)
JavaScript
14
star
4

command

Command pattern for Go with thread safe serial and parallel dispatcher
Go
14
star
5

fw

Micro PHP Framework
PHP
11
star
6

syte-yii

Syte as a Yii Framework module
JavaScript
5
star
7

itunes-cli

Objective-C
5
star
8

parseargs.js

A string argument parser that understands quotes and backslashes
JavaScript
4
star
9

retry-go

Retry a function execution with specific intervals with panic recovery
Go
4
star
10

meteor-namespace

Namespace helper for Meteor
JavaScript
3
star
11

jslib-dot

Dot notation setter and getter
JavaScript
2
star
12

tic-80-carts

JavaScript
2
star
13

pigo8

Go
2
star
14

safe

Safe file storage
Go
2
star
15

acl-go

A simple but powerful Access Control List manager
Go
2
star
16

yttr

A cli client for yttr.co
Go
2
star
17

meteor-simple-i18n-sample

https://github.com/txgruppi/meteor-simple-i18n
JavaScript
2
star
18

run

A tool for Docker containers that render config files, extend the environment and run commands
Go
2
star
19

bee.js

A bitwise powered event emitter :-)
JavaScript
2
star
20

youtube-cli

Objective-C
1
star
21

rproxy

A proxy that applies AES encryption over requests in order to prevent scrapers from easily accessing our data
Go
1
star
22

errorgroup-go

ErrorGroup is an error type that can hold other errors together.
Go
1
star
23

study-server

Go
1
star
24

fns

A set of Go functions to work with lazy sequences without reflection.
Go
1
star
25

node-gs-dl

Grooveshark Downloader
JavaScript
1
star
26

builtwith-cli

A command line interface for BuiltWith API
Shell
1
star
27

config

Go
1
star