MCPcopy Create free account
hub / github.com/Mister-leo/fssh / cmdRemove

Function cmdRemove

cmd/fssh/main.go:236–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234}
235
236func cmdRemove() {
237 fs := flag.NewFlagSet("remove", flag.ExitOnError)
238 alias := fs.String("alias", "", "alias name")
239 fs.Parse(os.Args[2:])
240 if *alias == "" { fatal(errors.New("alias is required")) }
241 if _, err := keychain.LoadMasterKey(); err != nil { fatal(err) }
242 path := filepath.Join(store.KeysDir(), *alias+".enc")
243 if err := os.Remove(path); err != nil { fatal(err) }
244 fmt.Printf("removed %s\n", *alias)
245}
246
247func cmdRekey() {
248 fs := flag.NewFlagSet("rekey", flag.ExitOnError)

Callers 1

mainFunction · 0.85

Calls 4

LoadMasterKeyFunction · 0.92
KeysDirFunction · 0.92
fatalFunction · 0.85
RemoveMethod · 0.80

Tested by

no test coverage detected