Disable identity & force-key flags

This commit is contained in:
Christian Muehlhaeuser 2020-08-24 14:53:55 +02:00
parent be478cbaf3
commit 2821cf2fb4
2 changed files with 23 additions and 14 deletions

View file

@ -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")

View file

@ -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
}