quran-go

Read Qur'an right in the terminal.
git clone http://git.hanabi.in/repos/quran-go.git
Log | Files | Refs | README | LICENSE

run.go (502B)


      1 package driver
      2 
      3 import (
      4 	"os"
      5 
      6 	d "git.hanabi.in/gitbox/quran-go/src/display"
      7 	p "git.hanabi.in/gitbox/quran-go/src/print"
      8 )
      9 
     10 // Driver code.
     11 func Run() (err error) {
     12 
     13 	option := "help"
     14 	if len(os.Args) > 1 {
     15 		option = os.Args[1]
     16 	}
     17 
     18 	switch option {
     19 	case "about":
     20 		p.About()
     21 	case "details":
     22 		p.Details()
     23 	case "version":
     24 		p.Version()
     25 	case "ls-translations":
     26 		if err = d.Translations(); err != nil {
     27 			return err
     28 		}
     29 	case "help":
     30 		p.Help()
     31 	default:
     32 		defaultBehaviuor()
     33 	}
     34 
     35 	return err
     36 
     37 }