From 2821cf2fb46be953a62df8262504c687863afda1 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 24 Aug 2020 14:53:55 +0200 Subject: [PATCH] Disable identity & force-key flags --- main.go | 8 +++++--- stash.go | 29 ++++++++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/main.go b/main.go index aaf9692..b0bf5e5 100644 --- a/main.go +++ b/main.go @@ -176,7 +176,7 @@ func executeArg(cmd *cobra.Command, arg string, w io.Writer) error { } // Config from flags - cfg.IdentityFile = identityFile + // cfg.IdentityFile = identityFile // Log to file, if set if cfg.Logfile != "" { @@ -294,8 +294,10 @@ func init() { rootCmd.Flags().UintVarP(&width, "width", "w", 0, "word-wrap at width") // For network-related operations, namely stashing and the TUI - rootCmd.PersistentFlags().StringVarP(&identityFile, "identity", "i", "", "path to identity file (that is, an ssh private key)") - rootCmd.PersistentFlags().BoolVarP(&forceKey, "force-key", "f", false, "force the use of the SSH key on disk (that is, ignore ssh-agent)") + /* + rootCmd.PersistentFlags().StringVarP(&identityFile, "identity", "i", "", "path to identity file (that is, an ssh private key)") + rootCmd.PersistentFlags().BoolVarP(&forceKey, "force-key", "f", false, "force the use of the SSH key on disk (that is, ignore ssh-agent)") + */ // Stash stashCmd.PersistentFlags().StringVarP(&memo, "memo", "m", "", "memo/note for stashing") diff --git a/stash.go b/stash.go index 6c55050..8019099 100644 --- a/stash.go +++ b/stash.go @@ -13,10 +13,13 @@ import ( ) var ( - identityFile string - forceKey bool - memo string - stashCmd = &cobra.Command{ + /* + identityFile string + forceKey bool + */ + + memo string + stashCmd = &cobra.Command{ Use: "stash SOURCE", Hidden: false, Short: "stash a markdown", @@ -49,13 +52,17 @@ func getCharmConfig() *charm.Config { if err != nil { log.Fatal(err) } - if identityFile != "" { - cfg.SSHKeyPath = identityFile - cfg.ForceKey = true - } - if forceKey { - cfg.ForceKey = true - } + + /* + if identityFile != "" { + cfg.SSHKeyPath = identityFile + cfg.ForceKey = true + } + if forceKey { + cfg.ForceKey = true + } + */ + return cfg }