File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99
1010- Minimum Go version is now 1.21
1111- Add Unwrap to PartialError (#815 )
12+ - Allow flags anywhere on the CLI (#814 )
13+
14+ ` goose ` uses the default Go ` flag ` parsing library, which means flags ** must** be defined before the
15+ first positional argument. We've updated this behavior to allow flags to be defined anywhere. For
16+ more details, see [ blog post] ( https://mfridman.com/blog/2024/allowing-flags-anywhere-on-the-cli/ ) .
17+
1218- Update ` WithDisableGlobalRegistry ` behavior (#783 ). When set, this will ignore globally-registered
1319 migrationse entirely instead of the previous behavior of raising an error. Specifically, the
1420 following check is removed:
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
1717 "text/tabwriter"
1818 "text/template"
1919
20+ "github.com/mfridman/xflag"
2021 "github.com/pressly/goose/v3"
2122 "github.com/pressly/goose/v3/internal/cfg"
2223 "github.com/pressly/goose/v3/internal/migrationstats"
@@ -45,7 +46,8 @@ func main() {
4546 ctx := context .Background ()
4647
4748 flags .Usage = usage
48- if err := flags .Parse (os .Args [1 :]); err != nil {
49+
50+ if err := xflag .ParseToEnd (flags , os .Args [1 :]); err != nil {
4951 log .Fatalf ("failed to parse args: %v" , err )
5052 return
5153 }
Original file line number Diff line number Diff line change 11module github.com/pressly/goose/v3
22
3- go 1.21
3+ go 1.21.0
44
55require (
66 github.com/ClickHouse/clickhouse-go/v2 v2.27.1
77 github.com/go-sql-driver/mysql v1.8.1
88 github.com/jackc/pgx/v5 v5.6.0
99 github.com/mfridman/interpolate v0.0.2
10+ github.com/mfridman/xflag v0.0.0-20240825232106-efb77353e578
1011 github.com/microsoft/go-mssqldb v1.7.2
1112 github.com/sethvargo/go-retry v0.3.0
1213 github.com/stretchr/testify v1.9.0
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
151151github.com/mattn/go-isatty v0.0.20 /go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y =
152152github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY =
153153github.com/mfridman/interpolate v0.0.2 /go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg =
154+ github.com/mfridman/xflag v0.0.0-20240825232106-efb77353e578 h1:CRrqlUmLebb/QjzRDWE0E66+YyN/v95+w6WyH9ju8/Y =
155+ github.com/mfridman/xflag v0.0.0-20240825232106-efb77353e578 /go.mod h1:/483ywM5ZO5SuMVjrIGquYNE5CzLrj5Ux/LxWWnjRaE =
154156github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA =
155157github.com/microsoft/go-mssqldb v1.7.2 /go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA =
156158github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0 =
You can’t perform that action at this time.
0 commit comments