Consider putting each ishell.Cmd in a separate file. Otherwise you can put 
them in a slice var so you don’t have to AddCmd each one explicitly.

I’m not sure what defining a struct accomplishes, can you provide more 
detail?

Matt

On Tuesday, April 17, 2018 at 8:25:17 PM UTC-5, Keith Brown wrote:
>
> I am writing an interactive CLI tool which looks like this, using 
> abisoft/ishell
>
> ./tool
> >>> help
>
> Sample Interactive Shell
> >>> help
>
> Commands:
>   clear      clear the screen
>   greet      greet user
>   exit       exit the program
>   help       display help
>
> >>> greet Someone Somewhere
> Hello Someone Somewhere
> >>> exit
>
> My tool will have many subcommands. 
>
> So, greet <subcommand> < subcommand> and I was wondering what would be a good 
> way to structure the program. I was thinking of putting everything in one 
> large struct and have nested structs for commands similar to JSON encoded 
> file.
>
> any thoughts?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to