<commit_before>cmd
===

A library to create shell-like command processors, slightly inspired by the Python cmd/cmd2 package

## Installation
    $ go get github.com/gobs/cmd

## Documentation
http://godoc.org/github.com/gobs/cmd

## Example

    import "github.com/gobs/cmd"
    
    // return true to stop command loop
    func Exit(line string) (stop bool) {
          fmt.Println("goodbye!")
          return true
    }
      
    // change the prompt
    func (cmd *Cmd) SetPrompt(line string) (stop bool) {
    cmd.Prompt = line
    return
    }
    
    // initialize Cmd structure
    commander := &cmd.Cmd{}
    commander.Init(Prompt: "> ")
    
    // add inline method
    commander.Add(cmd.Command{
          "ls",
          `list stuff`,
          func(line string) (stop bool) {<commit_msg>commander.Init() doesn't have any parameters<commit_after>cmd
===

A library to create shell-like command processors, slightly inspired by the Python cmd/cmd2 package

## Installation
    $ go get github.com/gobs/cmd

## Documentation
http://godoc.org/github.com/gobs/cmd

## Example

    import "github.com/gobs/cmd"
    
    // return true to stop command loop
    func Exit(line string) (stop bool) {
          fmt.Println("goodbye!")
          return true
    }
      
    // change the prompt
    func (cmd *Cmd) SetPrompt(line string) (stop bool) {
    cmd.Prompt = line
    return
    }
    
    // initialize Cmd structure
    commander := &cmd.Cmd{Prompt: "> ",}
    commander.Init()
    
    // add inline method
    commander.Add(cmd.Command{
          "ls",
          `list stuff`,
          func(line string) (stop bool) {
{'fraction_non_alphanumeric': 0.11416361416361416, 'fraction_numerical': 0.001221001221001221, 'mean_word_length': 2.2263779527559056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7499094', 'n_tokens_mistral': 508, 'n_tokens_neox': 502, 'n_words': 140}