Added a group addMember command

This commit is contained in:
Gregory Ballantine 2019-07-12 12:34:35 -04:00
parent 24e54d0ca5
commit e3b036bc57

View File

@ -16,14 +16,14 @@ import (
func init() {
// define group add subcommand flags
groupAddCmd.Flags().StringP("base_ou", "o", "", "LDAP OU to search for the group entry under")
groupAddCmd.Flags().StringP("id_attribute", "a", "cn", "LDAP DN attribute for groups")
groupAddCmd.Flags().StringVarP(&flagGroupName, "group_name", "n", "", "Name for the group")
groupAddCmd.Flags().StringVarP(&flagGroupType, "group_type", "t", "unix", "Type of the group")
groupAddCmd.Flags().StringVarP(&flagGroupMembers, "group_members", "m", "", "Members to add to the group (comma-separated list)")
groupAddMemberCmd.Flags().StringP("base_ou", "o", "", "LDAP OU to search for the group entry under")
groupAddMemberCmd.Flags().StringP("id_attribute", "a", "cn", "LDAP DN attribute for groups")
groupAddMemberCmd.Flags().StringVarP(&flagGroupName, "group_name", "n", "", "Name for the group")
groupAddMemberCmd.Flags().StringVarP(&flagGroupType, "group_type", "t", "unix", "Type of the group")
groupAddMemberCmd.Flags().StringVarP(&flagGroupMembers, "group_members", "m", "", "Members to add to the group (comma-separated list)")
// bind config file values to group add flags
viper.BindPFlag("group.base_ou", groupAddCmd.Flags().Lookup("base_ou"))
viper.BindPFlag("group.id_attr", groupAddCmd.Flags().Lookup("id_attribute"))
viper.BindPFlag("group.base_ou", groupAddMemberCmd.Flags().Lookup("base_ou"))
viper.BindPFlag("group.id_attr", groupAddMemberCmd.Flags().Lookup("id_attribute"))
}
// define group add subcommand