Skip to content

Commit

Permalink
Merge pull request #130 from gliderlabs/long-form-flags
Browse files Browse the repository at this point in the history
feat: add support for long-form flags
  • Loading branch information
josegonzalez authored Jun 29, 2024
2 parents cb754f7 + a890d3b commit bc62cc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/sigil.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"
"io"
"os"
Expand All @@ -10,15 +9,16 @@ import (

"github.com/gliderlabs/sigil"
_ "github.com/gliderlabs/sigil/builtin"
flag "github.com/spf13/pflag"
)

var Version string

var (
filename = flag.String("f", "", "use template file instead of STDIN")
inline = flag.String("i", "", "use inline template string instead of STDIN")
posix = flag.Bool("p", false, "preprocess with POSIX variable expansion")
version = flag.Bool("v", false, "prints version")
filename = flag.StringP("filename", "f", "", "use template file instead of STDIN")
inline = flag.StringP("inline", "i", "", "use inline template string instead of STDIN")
posix = flag.BoolP("posix", "p", false, "preprocess with POSIX variable expansion")
version = flag.BoolP("version", "v", false, "prints version")
)

func template() ([]byte, string, error) {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
github.com/jmespath/go-jmespath v0.4.0
github.com/mgood/go-posix v0.0.0-20150821180505-948c005421f5
github.com/spf13/pflag v1.0.5
gopkg.in/yaml.v2 v2.4.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/mgood/go-posix v0.0.0-20150821180505-948c005421f5 h1:AutzcJSqc7ROMqcj
github.com/mgood/go-posix v0.0.0-20150821180505-948c005421f5/go.mod h1:irVTeKOI2GrudEK6/mqR4dDlGH91lCZIZM34YKSKH7M=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

0 comments on commit bc62cc9

Please sign in to comment.