Mutually exclusive options for argparse
What you are looking for is add_mutually_exclusive_group. It allows you to define options that are mutually exclusive as well as specifying if selecting one of these options is a required action or not. And looking at your else: block, yours is; meaning if we call the program without arguments, it should fail with an error along the following:

usage: [-h] (-t TEXT | -f FILE)
program_name.py: error: one of the arguments -t/--text -f/--file is required


You are also handling files in your input and should avoid doing so manually. argparse provides a FileType object meant to be used as the type keyword of add_argument to handle files for you. It will fail with a proper error message if the file cannot be opened with the proper mode and will return the opened file object in the resulting parsed arguments.

Proposed improvements:

#!/usr/bin/env python

import argparse


def parse_command_line():
    parser = argparse.ArgumentParser()
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-t', '--text', help='Text')
    group.add_argument('-f', '--file', type=argparse.FileType('r'), help='File containing the text')
    return parser


if __name__ == '__main__':
    args = parse_command_line().parse_args()

    if args.text is not None:
        text = args.text
    elif args.file is not None:
        with args.file as f:
            text = f.read()

    # Program continues ...


Also note the use of with to properly close the provided file.