Add Username Function

This commit is contained in:
2024-10-09 07:41:51 -05:00
parent 365e343a95
commit 822b978034
5 changed files with 127 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ func init() {
rootCmd.AddCommand(getCmd)
}
func runGetCmd(cmd *cobra.Command, args []string) error {
func runGetCmd(_ *cobra.Command, args []string) error {
var path []string
for i := range args {
path = append(path, strings.Split(args[i], "/")...)
@@ -45,7 +45,7 @@ func runGetCmd(cmd *cobra.Command, args []string) error {
var entryErr error
list := db.GetGroupsAndEntriesFromRoot(path)
if len(list) == 0 {
return errors.New("Invalid Path")
return errors.New("invalid path")
} else if len(list) > 1 {
for i := range list {
fmt.Printf("%d. %s\n", i+1, list[i])