mvstermind / mini-cli

Minimalistic library for parsing command line arguments. Written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐ŸŽ‰ Mini Cli - The Teeny-Tiny Library for Mighty CLI Apps! ๐Ÿš€

Welcome to Mini Cli, the itty-bitty, teeny-weeny Go library that's small in size but HUGE in potential! It's your go-to toolkit for creating command-line apps with a minimalistic flair. Because why complicate things when you can keep it simple and snazzy? ๐Ÿ˜Ž

How to Dive In ๐ŸŠโ€โ™‚๏ธ

Want to get started with mini-cli? Of course, you do! Just run this magical command and you're golden:

go get github.com/mvstermind/mini-cli

Boom! You just snagged yourself a copy of the coolest CLI library in town. ๐ŸŽ‰

How to Play ๐ŸŽฎ

Simple Usage - The Bare Essentials ๐Ÿ› ๏ธ

Hereโ€™s a basic example thatโ€™ll get you up and running with Mini Cli faster than you can say "command-line interface!"

package main

import (
	"fmt"

	mini "github.com/mvstermind/mini-cli"
)

func main() {
	// Create a bunch of arguments (because one is never enough!)
	change := mini.Arg{
		ShortCmd: "c",
		LongCmd:  "change",
		Usage:    "Example usage",
		Required: true, // This oneโ€™s important!
	}

	del := mini.NewArg("c", "delete", "Deletes stuff", true)
	undo := mini.NewArg("u", "undo", "Undo stuff", true)
	revert := mini.NewArg("r", "revert", "Reverts stuff", false)

	// Toss those arguments into your command soup
	cmds := mini.AddArguments(&change, del, undo, revert)

	// Stir it all up and get those juicy argument values
	argValues := cmds.Execute()

	// Spill the beans on what "revert" is all about
	fmt.Println(argValues["-r"])
}

Why You'll Love It โค๏ธ

  • Minimalistic Magic: Focuses on keeping things simple and easy-peasy. โœจ
  • Flexible as a Rubber Band: Easily define and handle command-line arguments like a boss.
  • Auto-generated Command List: If you forget to pass those all-important flags, donโ€™t sweat it! mini-cli has your back and will auto-generate a list of what youโ€™re missing. ๐Ÿ“

Auto-generated Command List - The Safety Net ๐Ÿ•ธ๏ธ

If you skip out on those required flags, mini-cli will jump in and save the day by automatically listing what you need. Hereโ€™s a sneak peek of what that looks like:

Example Output

Required value that weren't included:
-c | --change
-d | --delete
-u | --undo

List of available commands:

-c  --change
    Example usage
    Required: true

-d  --delete
    Deletes stuff
    Required: true

-u  --undo
    Undo stuff
    Required: true

-r  --revert
    Reverts stuff
    Required: false

See? No more excuses for missing flags! Mini Cli has got you covered. ๐ŸŽฏ

Peek at Some Examples ๐Ÿ‘€

Want more examples? Of course, you do! Check out our examples section for a treasure trove of cool tricks you can do with mini-cli.

Contributing - Join the Fun! ๐ŸŽ‰

We love new ideas and improvements! If you want to jump into the Mini Cli madness, fork the repo, whip up some magic, and submit a pull request. Letโ€™s make CLI apps awesome together! ๐Ÿ’ช

License to Chill ๐ŸŽต

This project is licensed under the MIT License, so feel free to kick back, relax, and enjoy using mini-cli without a care in the world. ๐Ÿ–๏ธ

About

Minimalistic library for parsing command line arguments. Written in Go

License:MIT License


Languages

Language:Go 100.0%