def cmd_create_user(omni_app, realm_or_store, username, opt_stdin=False,
    opt_prompt_password=False):
    """
    Usage: omni create-user [options] <realm-or-store> <username>

    Adds a new user to a realm or a store.

    Options:

      -p, --prompt-password  Prompt for a password.
      -i, --stdin            Read password from standard input.
      -h, --help             Show this help message.
    """
    try:
        db = omni_app.get_realm_or_store(realm_or_store)
    except KeyError:
        return '{}: invalid realm/store'.format(realm_or_store)
    if opt_stdin:
        from sys import stdin
        new_pw = stdin.readline().strip()
    elif opt_prompt_password:
        from getpass import getpass
        old_pw = getpass('password for {}: '.format(username))
        new_pw = getpass('password for {} (again): '.format(username))
        if old_pw != new_pw:
            return 'passwords do not match'
    else:
        new_pw = '#*' + username + '*#'
    try:
        return db.create_user(username, password=new_pw)
    except NotImplementedError:
        return '{}: user creation not suported'.format(realm_or_store)
