#!/usr/bin/env python3
import os
from sys import argv
import shutil
######################################################
#  Author: John M. Morrison.  Released without warrantee with a GPL v3 license.
#  28 Aug 2023:  add full documentation
#                add error handling code for lack of a specified file name.
#  usages:
#       python deal.py file_name 
#  usage note: if you are running on UNIX with execute permissions, you can
#              omit the "python" in the two commands above if this file is located
#              in a directory in your $PATH.
#  product:
#       a copy of the file file_name is placed in each subdirectory
#       of your cwd.
######################################################
if len(argv) == 1:
    print("Usage:  python deal.py file_name")
    quit()
file_name = argv[1]
contents = os.listdir()
contents = [k for k in contents if os.path.isdir(k)]
for folder in contents:
    shutil.copy2(file_name, folder) 

