Skip to content

Commit

Permalink
cmd/shfmt: support long flags
Browse files Browse the repository at this point in the history
That is, we now allow flags like --minify as well as -mn.
Note that we just use Go's standard flag package,
so that means we also support -minify and --mn.

For consistency, the docs now use --filename and --version,
which is backwards compatible as the single-dash versions still work.

Fixes #852.
  • Loading branch information
mvdan committed May 9, 2022
1 parent fc08132 commit bdb1e1d
Show file tree
Hide file tree
Showing 8 changed files with 392 additions and 114 deletions.
2 changes: 1 addition & 1 deletion cmd/shfmt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.17.1-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY . .
RUN CGO_ENABLED=0 go build -ldflags "-w -s -extldflags '-static' -X main.version=$(git describe --always --dirty --tags)" ./cmd/shfmt
RUN CGO_ENABLED=0 go build -ldflags "-w -s -extldflags '-static' -X main.knownVersion=$(git describe --always --dirty --tags)" ./cmd/shfmt

FROM alpine:3.14.2 AS alpine
COPY --from=build /src/shfmt /bin/shfmt
Expand Down
Loading

0 comments on commit bdb1e1d

Please sign in to comment.