Skip to content

Commit

Permalink
Cat program revised (v2) (bugfix)
Browse files Browse the repository at this point in the history
Additional change:
* Fixed improper behavior if no arguments were passed
  • Loading branch information
DontEatThemCookies authored Mar 12, 2022
1 parent 5566d58 commit 34c08fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cat/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def no_files():

def main():
"""Entry point of the cat program."""
try:
# Read the arguments passed to the program
with_files(sys.argv[1:])
except IndexError:
# Read the arguments passed to the program
if not sys.argv[1:]:
no_files()
else:
with_files(sys.argv[1:])

if __name__ == "__main__":
main()

0 comments on commit 34c08fc

Please sign in to comment.