mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Disable identity & force-key flags
This commit is contained in:
parent
be478cbaf3
commit
2821cf2fb4
2 changed files with 23 additions and 14 deletions
8
main.go
8
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")
|
||||
|
|
29
stash.go
29
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue