File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ type Flags struct {
1111 Revert bool
1212 Path string // file path to migrate for fs based migrations
1313 Verbose bool
14+ Help bool
1415}
1516
1617func (f * Flags ) Setup () {
1718 flag .BoolVar (& f .Force , "f" , false , "whether to force a migration (ignores warnings)" )
1819 flag .BoolVar (& f .Revert , "revert" , false , "whether to apply the migration backwards" )
1920 flag .BoolVar (& f .Verbose , "verbose" , false , "enable verbose logging" )
21+ flag .BoolVar (& f .Help , "help" , false , "display help message" )
2022 flag .StringVar (& f .Path , "path" , "" , "file path to migrate for fs based migrations (required)" )
2123}
2224
@@ -29,6 +31,11 @@ func Run(m Migration) error {
2931 f .Setup ()
3032 f .Parse ()
3133
34+ if f .Help {
35+ flag .Usage ()
36+ os .Exit (0 )
37+ }
38+
3239 if f .Path == "" {
3340 flag .Usage ()
3441 return fmt .Errorf ("missing or empty path; flag '-path <ipfs_path>' is required" )
You can’t perform that action at this time.
0 commit comments