From 41394fa0278b7d2586c53fa3d2dd4d8a8f358cbb Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 12 Sep 2013 15:23:00 +0200 Subject: [PATCH] Added some arguments --- radiorec.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radiorec.py b/radiorec.py index b463aaf..97af199 100755 --- a/radiorec.py +++ b/radiorec.py @@ -11,7 +11,12 @@ import configparser import urllib.request def main(): - # TODO: Implement argparse + parser = argparse.ArgumentParser(description='This program records internet radio streams.') + parser.add_argument('station', type=str, help='Name of the radio station ' + '(see config file for a list)') + parser.add_argument('duration', type=int, help='Recording time in minutes') + parser.add_argument('name', nargs='?', type=str, help='A name for the recording') + args = parser.parse_args() if __name__ == '__main__': main()