Changeset 59 in code for trunk


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@…>

Location:
trunk
Files:
3 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]
  • trunk/go.mod

    r56 r59  
    55require (
    66        github.com/russross/blackfriday/v2 v2.1.0
     7        github.com/sirupsen/logrus v1.9.0
    78        gopkg.in/yaml.v2 v2.4.0
    89)
     10
     11require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
  • trunk/go.sum

    r48 r59  
     1github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
     2github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
     3github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
     4github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
     5github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
    16github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
    27github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
     8github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
     9github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
     10github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
     11github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
     12github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
     13golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
     14golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
    315gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
    416gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
    517gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
    618gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
     19gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
     20gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Note: See TracChangeset for help on using the changeset viewer.