cmd

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2020 License: GPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "gotree",
	Short: "gotree: A set of tools to handle phylogenetic trees in go",
	Long: `gotree is a set of tools to handle phylogenetic trees in go.

Different usages are implemented: 
- Generating random trees
- Transforming trees (renaming tips, pruning/removing tips)
- Comparing trees (computing bootstrap supports, counting common edges)
`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		switch rootInputFormat {
		case "newick":
			treeformat = utils.FORMAT_NEWICK
		case "nexus":
			treeformat = utils.FORMAT_NEXUS
		case "phyloxml":
			treeformat = utils.FORMAT_PHYLOXML
		default:
			treeformat = utils.FORMAT_NEWICK
		}
		if seed == -1 {
			seed = time.Now().UTC().UnixNano()
		}
		rand.Seed(seed)
	},

	Run: func(cmd *cobra.Command, args []string) {
		s := cobrashell.New()

		s.Println(fmt.Sprintf("Welcome to Gotree Console %s", Version))
		s.Println("type \"help\" to get a list of available commands")
		cobrashell.AddCommands(s, cmd.Root(), nil, cmd.Root().Commands()...)

		s.Run()
	},

	PersistentPostRun: func(cmd *cobra.Command, args []string) {
	},
}

RootCmd represents the base command when called without any subcommands

View Source
var Version string

Version defines the version of gotree It is initialized during compilation with -ldflags "-X github.com/evolbioinfo/gotree/cmd.Version=Major.Minor..."

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func Readln added in v0.1.5

func Readln(r *bufio.Reader) (string, error)

Readln returns a single line (without the ending \n) from the input buffered reader. An error is returned iff there is an error with the buffered reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL