Skip to content

Conversation

@managedkaos
Copy link

Get help:

22:05 $ ./hackernews.py -h
usage: hackernews.py [-h] [int]

positional arguments:
  int         Then number of news items to return, from 1 to 30

optional arguments:
  -h, --help  show this help message and exit

Default is 10:

22:08 $ ./hackernews.py
1. Video Games Are Destroying the People Who Make Them
https://www.nytimes.com/2017/10/25/opinion/work-culture-video-games-crunch.html

2. Microsoft Has Stopped Manufacturing The Kinect
https://www.fastcodesign.com/90147868/exclusive-microsoft-has-stopped-manufacturing-the-kinect
...

Get more than 10:

22:08 $ ./hackernews.py 20

But you can only get 30:

22:08 $ ./hackernews.py 31
usage: hackernews.py [-h] [int]
hackernews.py: error: argument int: invalid choice: 31 (choose from 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants