-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from cyverse/transfer_report
Transfer report
- Loading branch information
Showing
56 changed files
with
5,553 additions
and
2,937 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
v0.9.10 | ||
v0.9.11 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package flag | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type TransferReportFlagValues struct { | ||
ReportPath string | ||
Report bool | ||
ReportToStdout bool | ||
} | ||
|
||
var ( | ||
transferReportFlagValues TransferReportFlagValues | ||
) | ||
|
||
func SetTransferReportFlags(command *cobra.Command) { | ||
command.Flags().StringVar(&transferReportFlagValues.ReportPath, "report", "", "Create a transfer report, give path to create a file, empty string or '-' will output to stdout") | ||
} | ||
|
||
func GetTransferReportFlagValues(command *cobra.Command) *TransferReportFlagValues { | ||
if command.Flags().Changed("report") { | ||
transferReportFlagValues.Report = true | ||
} | ||
|
||
transferReportFlagValues.ReportToStdout = false | ||
|
||
if transferReportFlagValues.ReportPath == "-" || len(transferReportFlagValues.ReportPath) == 0 { | ||
transferReportFlagValues.ReportToStdout = true | ||
} | ||
|
||
return &transferReportFlagValues | ||
} |
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
Oops, something went wrong.