def user_create(attribs, dir_info)
      attribs = user_record_name_alternatives(attribs)

      check_critical_attribute( attribs, :record_name )
      # attribs           = tidy_attribs(attribs).dup
      attribs           = tidy_attribs(attribs)

      answer            = []
      attribs[:value]   = nil
      answer           << user_create_min(attribs, dir_info)
      if attribs[:first_name] or attribs[:firstname] or attribs[:given_name] or
                          attribs[:givenname]
        attribs[:value] = nil
        answer         << user_set_first_name(attribs, dir_info)
      end
      if attribs[:email] or attribs[:mail] or attribs[:apple_user_mailattribute]
        attribs[:value] = nil
        answer         << user_set_email(attribs, dir_info)
      end
      if attribs[:relations] or attribs[:relationships]
        attribs[:value] = nil
        answer         << user_set_relationships(attribs, dir_info)
      end
      if attribs[:org_info] or attribs[:organization_info]
        attribs[:value] = nil
        answer         << user_set_organization_info(attribs, dir_info)
      end
      if attribs[:title]
        attribs[:value] = nil
        answer         << user_set_title(attribs, dir_info)
      end
      if attribs[:department] or attribs[:departmentnumber] or attribs[:department_number]
        attribs[:value] = nil
        answer         << user_set_department(attribs, dir_info)
      end
      if attribs[:company]
        attribs[:value] = nil
        answer         << user_set_company(attribs, dir_info)
      end
      if attribs[:address]
        attribs[:value] = nil
        answer         << user_set_address(attribs, dir_info)
      end
      if attribs[:city] or attribs[:town]
        attribs[:value] = nil
        answer         << user_set_city(attribs, dir_info)
      end
      if attribs[:state]
        attribs[:value] = nil
        answer         << user_set_state(attribs, dir_info)
      end
      if attribs[:country]
        attribs[:value] = nil
        answer         << user_set_country(attribs, dir_info)
      end
      if attribs[:keyword] or attribs[:keywords]
        attribs[:value] = nil
        answer         << user_set_keywords(attribs, dir_info)
      end
      if attribs[:group_name] or attribs[:groupname] or attribs[:gid] or
                        attribs[:group_membership] or attribs[:groupmembership]
        attribs[:value] = nil
        answer         << user_add_to_group(attribs, dir_info)
      end

      return answer.flatten
    end
def user_create(attribs, dir_info)
      attribs = user_record_name_alternatives(attribs)

      check_critical_attribute( attribs, :record_name )
      # attribs           = tidy_attribs(attribs).dup
      attribs           = tidy_attribs(attribs)

      answer            = []
      attribs[:value]   = nil
      answer           << user_create_min(attribs, dir_info)
      if attribs[:first_name] or attribs[:firstname] or attribs[:given_name] or
                          attribs[:givenname]
        attribs[:value] = nil
        answer         << user_set_first_name(attribs, dir_info)
      end
      if attribs[:email] or attribs[:mail] or attribs[:apple_user_mailattribute]
        attribs[:value] = nil
        answer         << user_set_email(attribs, dir_info)
      end
      if attribs[:relations] or attribs[:relationships]
        attribs[:value] = nil
        answer         << user_set_relationships(attribs, dir_info)
      end
      if attribs[:org_info] or attribs[:organization_info]
        attribs[:value] = nil
        answer         << user_set_organization_info(attribs, dir_info)
      end
      if attribs[:title]
        attribs[:value] = nil
        answer         << user_set_title(attribs, dir_info)
      end
      if attribs[:department] or attribs[:departmentnumber] or attribs[:department_number]
        attribs[:value] = nil
        answer         << user_set_department(attribs, dir_info)
      end
      if attribs[:company]
        attribs[:value] = nil
        answer         << user_set_company(attribs, dir_info)
      end
      if attribs[:address]
        attribs[:value] = nil
        answer         << user_set_address(attribs, dir_info)
      end
      if attribs[:city] or attribs[:town]
        attribs[:value] = nil
        answer         << user_set_city(attribs, dir_info)
      end
      if attribs[:state]
        attribs[:value] = nil
        answer         << user_set_state(attribs, dir_info)
      end
      if attribs[:country]
        attribs[:value] = nil
        answer         << user_set_country(attribs, dir_info)
      end
      if attribs[:keyword] or attribs[:keywords]
        attribs[:value] = nil
        answer         << user_set_keywords(attribs, dir_info)
      end
      if attribs[:group_name] or attribs[:groupname] or attribs[:gid] or
                        attribs[:group_membership] or attribs[:groupmembership]
        attribs[:value] = nil
        answer         << user_add_to_group(attribs, dir_info)
      end

      return answer.flatten
    end
https://images.apple.com/server/docs/Command_Line.pdf
 https://serverfault.com/questions/20702/how-do-i-create-user-accounts-from-the-terminal-in-mac-os-x-10-5?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
 https://superuser.com/questions/1154564/how-to-create-a-user-from-the-macos-command-line