Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally ignore extra dirs in gen-make-frag.sh. #833

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fgvanzee
Copy link
Member

Details:

  • Implemented an option (-i LIST) to gen-make-frag.sh that allows the caller to optionally ignore additional directories when walking the source directory. (Note that previously the standard -- and only -- way to ignore directories was to add them to the ignore_list file, which is a required argument to the script.)
  • I implemented this feature for something but then ended up not needing it, but figured it might be helpful in the future.

Details:
- Implemented an option (-i LIST) to gen-make-frag.sh that allows the
  caller to optionally ignore additional directories when walking the
  source directory. (Note that previously the standard -- and only --
  way to ignore directories was to add them to the ignore_list file,
  which is a required argument to the script.)
- I implemented this feature for something but then ended up not needing
  it, but figured it might be helpful in the future.
@@ -86,6 +86,9 @@ print_usage()
echo " root_dir."
echo " -h hide"
echo " Hide the makefile fragments by prepending filenames with '.'."
echo " -i LIST ignore"
echo " Augment the list of directory names contained in ign_list"
echo " with the directory names in LIST."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like configure.sh, here-docs can improve readability and maintainability.

cat <<EOF
Enter
Text
Here
EOF

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. :)

case $opt in
d ) dry_run_flag="1" ;;
h ) hide_flag="1" ;;
r ) recursive_flag="1" ;;
i ) ignore_list="$OPTARG" ;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be ignore_list="$ignore_list $OPTARG" to allow for multiple -i options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I've made the change.

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.

3 participants