adding custom config library, can read/write TOML, started config validation
This commit is contained in:
		
							
								
								
									
										24
									
								
								client/test/test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								client/test/test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
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()
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user