command-line implementation