25 lines
		
	
	
		
			438 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			438 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package main
 | 
						|
 | 
						|
import (
 | 
						|
	"fmt"
 | 
						|
 | 
						|
	"github.com/deranjer/clir"
 | 
						|
)
 | 
						|
 | 
						|
func main() {
 | 
						|
 | 
						|
	// Create new cli
 | 
						|
	cli := clir.NewCli("Other Args", "A basic example", "v0.0.1")
 | 
						|
 | 
						|
	// Set long description
 | 
						|
	cli.LongDescription("This app shows positional arguments")
 | 
						|
 | 
						|
	name := cli.NewSubCommand("name", "Shows your name!")
 | 
						|
	name.Action(func() error {
 | 
						|
		fmt.Printf("The remaining arguments were: %+v\n", name.OtherArgs())
 | 
						|
		return nil
 | 
						|
	})
 | 
						|
	// Run!
 | 
						|
	cli.Run()
 | 
						|
}
 |