Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Foxcapades/Argonaut

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Foxcapades/Argonaut

  • v1.4.10
  • Source
  • Go
  • Socket score

Version published
Created
Source

= Argonaut :repo: https://github.com/Foxcapades/Argonaut

++++

++++

Argonaut is a builder-style CLI creation kit packed with features.

image:https://img.shields.io/github/license/Foxcapades/Argonaut[GitHub] image:https://img.shields.io/github/v/tag/Foxcapades/Argonaut?label=version[GitHub tag (latest SemVer), link=https://github.com/Foxcapades/Argonaut/releases/latest] image:https://goreportcard.com/badge/github.com/Foxcapades/Argonaut[link=https://goreportcard.com/report/github.com/Foxcapades/Argonaut] image:https://img.shields.io/badge/go-docs-blue[Static Badge,link=https://pkg.go.dev/github.com/Foxcapades/Argonaut] image:https://img.shields.io/badge/wiki-docs-purple[Wiki,link=https://github.com/Foxcapades/Argonaut/wiki]

[source, go]

import ( cli "github.com/Foxcapades/Argonaut" )

== Features

  • Builder-style API.

[source, go]

cli.Flag(). WithArgument(cli.Argument(). WithName("file"). Require())

  • Build singular command applications or command trees.

[source, go]

cli.Command() // OR cli.Tree()

  • Overridable automatic help text generation.

[source, console]

Usage: my-app [options] This is a simple command tree example.

Flags -h | --help Prints this help text.

Commands fizz Aliases: fi This is the description for the fizz branch. foo Aliases: fo this is the description for the foo branch

  • Bind command line arguments to variables of arbitrary types.

[source, go]

foo := uint8(0)

cli.Argument().WithBinding(&foo)

  • Multi-use flags.

[source, console]

$ foo --bar --bar --bar bar = 3

  • Stackable short flags.

[source, console]

$ app -abc=4 a = true b = true c = 4

  • Callback hooks.

[source, go]

cli.Flag().WithCallback(func(Flag){}) cli.Command().WithCallback(func(Command){}) cli.Tree().WithCallback(func(Tree){}) cli.Branch().WithCallback(func(Branch){}) cli.Leaf().WithCallback(func(Leaf){})

  • Customizable or overridable unmarshalling of almost any type.

[source, go]

var options argo.UnmarshalProps ... cli.Argument().WithUnmarshaler(argo.NewMagicUnmarshaler(options))

  • Default values for flags and arguments.

[source, go]

var foo int32 cli.Argument().WithBinding(&foo).WithDefault(int32(666))

  • Input validation hooks.

[source, go]

var bind uint8 cli.Argument(). WithBinding(&bind) WithValidator(func(string) {}). WithValidator(func(string, int8) {})

  • Automatic capturing of "passthrough" flags and arguments.

[source, console]

$ foo bar --fizz=buzz -- apple banana canteloupe Passthroughs: apple, banana, canteloupe

  • And more!

== Examples

. https://github.com/Foxcapades/Argonaut/tree/master/examples/complex-type[Complex Types] . https://github.com/Foxcapades/Argonaut/tree/master/examples/number-extras[Number Format Extras] . https://github.com/Foxcapades/Argonaut/tree/master/examples/simple-tree[Simple Tree]

FAQs

Package last updated on 21 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc