forked from toolshed/abra
		
	refactor: move making app struct to construct func
makes the code cleaner and easier to grab the app struct for testing
This commit is contained in:
		@ -41,8 +41,7 @@ var DebugFlag = &cli.BoolFlag{
 | 
			
		||||
	Usage:       "Show DEBUG messages",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// RunApp runs CLI abra app.
 | 
			
		||||
func RunApp(version, commit string) {
 | 
			
		||||
func newAbraApp(version, commit string) *cli.App {
 | 
			
		||||
	app := &cli.App{
 | 
			
		||||
		Name: "abra",
 | 
			
		||||
		Usage: `The Co-op Cloud command-line utility belt 🎩🐇
 | 
			
		||||
@ -108,6 +107,12 @@ func RunApp(version, commit string) {
 | 
			
		||||
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	return app
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// RunApp runs CLI abra app.
 | 
			
		||||
func RunApp(version, commit string) {
 | 
			
		||||
	app := newAbraApp(version, commit)
 | 
			
		||||
 | 
			
		||||
	if err := app.Run(os.Args); err != nil {
 | 
			
		||||
		logrus.Fatal(err)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user