diff --git a/implement-cowsay/main.py b/implement-cowsay/main.py new file mode 100644 index 00000000..31454da4 --- /dev/null +++ b/implement-cowsay/main.py @@ -0,0 +1,11 @@ +import cowsay +import argparse + +parser = argparse.ArgumentParser(prog="cowsay", description="displays cowsay charactor with given arguments") +parser.add_argument('--animal', choices=cowsay.char_names, default="cow", help= 'please enter a valid animal') +parser.add_argument('message', nargs="+", help= 'please enter a message') +arg = parser.parse_args() + +msg = " ".join(arg.message) +animal_func = getattr(cowsay, arg.animal) +print(animal_func(msg)) diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 00000000..c6b9ffd0 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay diff --git a/individual-shell-tools/ls/script-01.sh b/individual-shell-tools/ls/script-01.sh deleted file mode 100755 index 241b62f5..00000000 --- a/individual-shell-tools/ls/script-01.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# Do not change this part of the script - only change after the TODO comment. - -script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -if [[ "${script_dir}" != "$(pwd)" ]]; then - echo >&2 "ERROR: You haven't cd'd into the correct directory." - echo >&2 "For each exercise, you should cd to the directory containing the script before running it." - exit 1 -fi - -# TODO: Write a command to list the files and folders in this directory. -# The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more. diff --git a/individual-shell-tools/ls/script-02.sh b/individual-shell-tools/ls/script-02.sh deleted file mode 100755 index d0a5a10f..00000000 --- a/individual-shell-tools/ls/script-02.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# TODO: Write a command which lists all of the files in the directory named child-directory. -# The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt.