func getFirstEntry(args []string) { os.Args = args flag.Parse() args = flag.Args() if len(args) < 1 { man("getFirstEntry") return } chainid := args[0] entry, err := factom.GetFirstEntry(chainid) if err != nil { errorln(err) return } printEntry(entry) }
flag.Parse() args = flag.Args() var chainid string if len(args) < 1 && len(nameCollector) == 0 { fmt.Println(cmd.helpMsg) return } if len(nameCollector) != 0 { chainid = nametoid(nameCollector) } else { chainid = args[0] } entry, err := factom.GetFirstEntry(chainid) if err != nil { errorln(err) return } fmt.Println(entry) } help.Add("get firstentry", cmd) return cmd }() var getHead = func() *fctCmd { cmd := new(fctCmd) cmd.helpMsg = "factom-cli get head" cmd.description = "Get the latest completed directory block" cmd.execFunc = func(args []string) {