Skip to content

Commit

Permalink
- [*] v1.2.3: using the standard wireframe template, closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
suntong committed Apr 19, 2020
1 parent 2b4a105 commit dcbedfe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions cascadia_cli.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# program name, name for the executable
ProgramName: cascadia
Authors: Tong Sun

PackageName: main

Expand Down
20 changes: 13 additions & 7 deletions cascadia_cliDef.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
////////////////////////////////////////////////////////////////////////////
// Program: cascadiaC
// Purpose: cascadia wrapper
// Authors: Tong Sun (c) 2018, All rights reserved
// Authors: Tong Sun (c) 2020, All rights reserved
////////////////////////////////////////////////////////////////////////////

package main

import (
"github.com/go-easygen/cli"
clix "github.com/go-easygen/cli/ext"
// "fmt"
// "os"

"github.com/mkideal/cli"
// "github.com/mkideal/cli/clis"
clix "github.com/mkideal/cli/ext"
)

////////////////////////////////////////////////////////////////////////////
Expand All @@ -31,7 +35,8 @@ type rootT struct {

var root = &cli.Command{
Name: "cascadiaC",
Desc: "cascadia wrapper\nVersion " + version + " built on " + date,
Desc: "cascadia wrapper\nVersion " + version + " built on " + date +
"\nCopyright (C) 2020, Tong Sun",
Text: "Command line interface to go cascadia CSS selectors package" +
"\n\nUsage:\n cascadia -i in -c css -o [Options...]",
Argv: func() interface{} { return new(rootT) },
Expand Down Expand Up @@ -63,7 +68,7 @@ var root = &cli.Command{
// var (
// progname = "cascadiaC"
// version = "0.1.0"
// date = "2018-05-22"
// date = "2020-04-19"

// rootArgv *rootT
// // Opts store all the configurable options
Expand All @@ -75,18 +80,19 @@ var root = &cli.Command{

// Function main
// func main() {
// cli.SetUsageStyle(cli.ManualStyle) // up-down, for left-right, use NormalStyle
// cli.SetUsageStyle(cli.DenseNormalStyle) // left-right, for up-down, use ManualStyle
// //NOTE: You can set any writer implements io.Writer
// // default writer is os.Stdout
// if err := cli.Root(root,).Run(os.Args[1:]); err != nil {
// fmt.Fprintln(os.Stderr, err)
// os.Exit(1)
// }
// fmt.Println("")
// }

// Template for main dispatcher starts here
//==========================================================================
// Main dispatcher
// Dumb root handler

// func cascadiaC(ctx *cli.Context) error {
// ctx.JSON(ctx.RootArgv())
Expand Down
2 changes: 1 addition & 1 deletion cascadia_cliGen.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
easygen -tf ../../suntong/cli/cli-tx cascadia_cli | gofmt > cascadia_cliDef.go
easygen ../../go-easygen/wireframe/cli-ext cascadia_cli | gofmt > cascadia_cliDef.go
8 changes: 4 additions & 4 deletions cascadia_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/PuerkitoBio/goquery"
"github.com/andybalholm/cascadia"
"github.com/go-easygen/cli"
"github.com/mkideal/cli"
"golang.org/x/net/html"
)

Expand All @@ -40,8 +40,8 @@ type MapStringString struct {

var (
progname = "cascadia"
version = "1.2.2"
date = "2018-05-22"
version = "1.2.3"
date = "2020-04-20"

rootArgv *rootT
)
Expand All @@ -52,7 +52,7 @@ var WrapHTMLBeg string
// Function definitions

func main() {
cli.SetUsageStyle(cli.DenseNormalStyle)
cli.SetUsageStyle(cli.DenseNormalStyle)
if err := cli.Root(root).Run(os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, err)
}
Expand Down

0 comments on commit dcbedfe

Please sign in to comment.