Skip to content

Commit

Permalink
Merge pull request #35 from toughnoah/qa
Browse files Browse the repository at this point in the history
Qa
  • Loading branch information
toughnoah authored Jul 28, 2021
2 parents 922875f + ec40d10 commit 8f6772d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ install: ## build blackbean.

clean: ## Remove test report.
@rm -f *.out

3 changes: 2 additions & 1 deletion cmd/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func restoreSnapshot(cli *elasticsearch.Client, out io.Writer) *cobra.Command {
}
)
f := command.Flags()
f.StringVar(&snapshots, "snapshot", "_all", "to get specific snapshot")
f.StringVar(&snapshots, "snapshot", "", "to get specific snapshot")
err := command.RegisterFlagCompletionFunc("snapshot", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) == 1 {
return so.getRepoAllSnapshotsForFlag(args[0]), cobra.ShellCompDirectiveNoFileComp
Expand All @@ -171,6 +171,7 @@ func restoreSnapshot(cli *elasticsearch.Client, out io.Writer) *cobra.Command {
_ = command.MarkFlagRequired("index")
_ = command.MarkFlagRequired("rename_pattern")
_ = command.MarkFlagRequired("rename_replacement")
_ = command.MarkFlagRequired("snapshot")
return command
}

Expand Down
11 changes: 0 additions & 11 deletions pkg/util/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ func Unmarshal(data []byte, v interface{}) error {
}
}

//// ToJSON converts a single YAML document into a JSON document
//// or returns an error. If the document appears to be JSON the
//// YAML decoding path is not used (so that error messages are
//// JSON specific).
//func ToJSON(data []byte) ([]byte, error) {
// if hasJSONPrefix(data) {
// return data, nil
// }
// return yaml.YAMLToJSON(data)
//}

// YAMLToJSONDecoder decodes YAML documents from an io.Reader by
// separating individual documents. It first converts the YAML
// body to JSON, then unmarshals the JSON.
Expand Down

0 comments on commit 8f6772d

Please sign in to comment.