Skip to content

make type determination more flexible. #8

Open

Description

@JustinAzoff

Some usernames may be first.last, which get_type currently thinks is a hostname.

argument types should possibly be pluggable, or possibly plugins should be able to set allowed types to a regular expression.

For username specifically it should configurable from the main configuration file. Username is the only current type that is site specific.

Also, I wonder if expanding the api to support type specific get_info functions may be a good idea...

so a plugin class could implement...

get_info_ip(arg):
get_info_hostname(arg):

rather than having plugins do it themselves:

get_info(arg):
    t = get_type(arg)
    if t == 'ip':
        ....
    elif t == 'hostname':
        ....

Activity

  1. JustinAzoff commented on Jan 3, 2014

    @JustinAzoff
    CollaboratorAuthor

    also need to support email addresses. One complication is places may use email addresses as usernames. In that case should get_type return username or email?

  2. JustinAzoff commented on Mar 5, 2014

    @JustinAzoff
    CollaboratorAuthor

    One solution for some plugins: instead of .types, support a .regex field that must match the argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions