<commit_before>package facade

import (
	"bytes"

	"github.com/spf13/cobra"
	"github.com/spiegel-im-spiegel/gocli/rwi"
	"github.com/spiegel-im-spiegel/gpgpdump"
	"github.com/spiegel-im-spiegel/errs"
	"github.com/spiegel-im-spiegel/gpgpdump/hkp"
)

//newHkpCmd returns cobra.Command instance for show sub-command
func newHkpCmd(ui *rwi.RWI) *cobra.Command {
	hkpCmd := &cobra.Command{
		Use:   "hkp [flags] <user ID or key ID>",
		Short: "Dumps from OpenPGP key server",
		Long:  "Dumps from OpenPGP key server",
		RunE: func(cmd *cobra.Command, args []string) error {
			opts := parseOpt(cmd)
			//user id
			if len(args) == 0 {
				return debugPrint(ui, ecode.ErrUserID)
			}
			userID := args[0]

			//options
			sks, err := cmd.Flags().GetString("keyserver")
			if err != nil {
				return debugPrint(ui, errs.Wrap(err, "error in --keyserver option"))
			}
			if len(sks) == 0 {
				return debugPrint(ui, errs.Wrap(ecode.ErrEmptyKeyServer, "error in --keyserver option"))
			}<commit_msg>Fix bug of error handling<commit_after>package facade

import (
	"bytes"

	"github.com/spf13/cobra"
	"github.com/spiegel-im-spiegel/errs"
	"github.com/spiegel-im-spiegel/gocli/rwi"
	"github.com/spiegel-im-spiegel/gpgpdump"
	"github.com/spiegel-im-spiegel/gpgpdump/ecode"
	"github.com/spiegel-im-spiegel/gpgpdump/hkp"
)

//newHkpCmd returns cobra.Command instance for show sub-command
func newHkpCmd(ui *rwi.RWI) *cobra.Command {
	hkpCmd := &cobra.Command{
		Use:   "hkp [flags] <user ID or key ID>",
		Short: "Dumps from OpenPGP key server",
		Long:  "Dumps from OpenPGP key server",
		RunE: func(cmd *cobra.Command, args []string) error {
			opts := parseOpt(cmd)
			//user id
			if len(args) == 0 {
				return debugPrint(ui, ecode.ErrUserID)
			}
			userID := args[0]

			//options
			sks, err := cmd.Flags().GetString("keyserver")
			if err != nil {
				return debugPrint(ui, errs.Wrap(err, "error in --keyserver option"))
			}
			if len(sks) == 0 {
				return debugPrint(ui, errs.Wrap(ecode.ErrEmptyKeyServer, "error in --keyserver option"))
			}
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.004901960784313725, 'mean_word_length': 3.6281179138321997, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2820014', 'n_tokens_mistral': 912, 'n_tokens_neox': 804, 'n_words': 173}