-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also remove testing package from import dependency chain (testing defines some flags)
- Loading branch information
Showing
10 changed files
with
89 additions
and
169 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) 2018 Storj Labs, Inc. | ||
// See LICENSE for copying information. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"storj.io/storj/pkg/cfgstruct" | ||
"storj.io/storj/pkg/process" | ||
) | ||
|
||
var ( | ||
runCfg Config | ||
runCmd = &cobra.Command{ | ||
Use: "run", | ||
Short: "Run the S3 gateway", | ||
RunE: cmdRun, | ||
} | ||
) | ||
|
||
func init() { | ||
RootCmd.AddCommand(runCmd) | ||
cfgstruct.Bind(runCmd.Flags(), &runCfg, cfgstruct.ConfDir(defaultConfDir)) | ||
runCmd.Flags().String("config", filepath.Join(defaultConfDir, "config.yaml"), "path to configuration") | ||
} | ||
|
||
func cmdRun(cmd *cobra.Command, args []string) (err error) { | ||
for _, flagname := range args { | ||
return fmt.Errorf("%s - Invalid flag. Try 'uplink run'", flagname) | ||
} | ||
|
||
return runCfg.Run(process.Ctx(cmd)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters