Changeset 59 in code for trunk/cmd


Ignore:
Timestamp:
Apr 18, 2023, 12:29:12 PM (2 years ago)
Author:
Izuru Yakumo
Message:

Add a more detailed usage note, and use logrus

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmd/aya/main.go

    r58 r59  
    66        "io"
    77        "io/ioutil"
    8         "log"
    98        "os"
    109        "os/exec"
     
    1716        "gopkg.in/yaml.v2"
    1817        "marisa.chaotic.ninja/aya"
     18        log "github.com/sirupsen/logrus"
    1919)
    2020
     
    304304}
    305305
     306func printUsage() {
     307        fmt.Printf("%v <command> [args]\n", os.Args[0])
     308        fmt.Printf("\n")
     309        fmt.Printf("Where <command> is:\n")
     310        fmt.Printf("\tbuild\tGenerate site\n")
     311        fmt.Printf("\twatch\t(Re)generate site while looking for changes\n")
     312        fmt.Printf("\tvar\tQuery a variable from a markdown file\n")
     313        fmt.Printf("\tversion\tPrint version and exit\n")
     314        fmt.Printf("\n")
     315        fmt.Printf("Other commands may be dynamically added by plugins found in %v\n", AYADIR)
     316        os.Exit(0)
     317}
     318
    306319func main() {
    307320        if len(os.Args) == 1 {
    308                 fmt.Println(os.Args[0], "<command> [args]")
    309                 return
     321                printUsage()
    310322        }
    311323        cmd := os.Args[1]
Note: See TracChangeset for help on using the changeset viewer.