3 # Python interface to the Internet finger daemon.
5 # Usage: finger [options] [user][@host] ...
7 # If no host is given, the finger daemon on the local host is contacted.
8 # Options are passed uninterpreted to the finger daemon!
15 # Hardcode the number of the finger port here.
16 # It's not likely to change soon...
21 # Function to do one remote finger invocation.
22 # Output goes directly to stdout (although this can be changed).
24 def finger(host, args):
25 s = socket(AF_INET, SOCK_STREAM)
26 s.connect((host, FINGER_PORT))
35 # Main function: argument parsing.
40 while i < len(sys.argv) and sys.argv[i][:1] == '-':
41 options = options + sys.argv[i] + ' '
48 at = string.index(arg, '@')
53 finger(host, options + arg)
56 # Call the main function.