Exemplo n.º 1
0
Arquivo: info.go Projeto: chambbj/skye
func RunInfo(cmd *cobra.Command, args []string) {
	if input == "" {
		fmt.Println("input filename must be provided")
		cmd.Usage()
		return
	}

	if _, err := os.Stat(input); os.IsNotExist(err) {
		fmt.Printf("No such file or directory: %s\n", input)
		cmd.Usage()
		return
	}

	utils.RunPdal("info", input)
}
Exemplo n.º 2
0
Arquivo: skye.go Projeto: chambbj/skye
var versionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print the version number of Skye",
	Long:  "",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Skye v0.1 -- HEAD")
	},
}

var driversCmd = &cobra.Command{
	Use:   "drivers",
	Short: "Print PDAL's available drivers",
	Long:  "",
	Run: func(cmd *cobra.Command, args []string) {
		utils.RunPdal("--drivers")
	},
}

// Execute adds all child commands to the root command SkyeCmd and sets flags
// appropriately.
func Execute() {
	AddCommands()
	SkyeCmd.Execute()
}

// AddCommands adds child commands to the root SkyeCmd.
func AddCommands() {
	SkyeCmd.AddCommand(colorizeCmd)
	SkyeCmd.AddCommand(convertCmd)
	SkyeCmd.AddCommand(cropCmd)