DEV Community

Michael Brackett
Michael Brackett

Posted on

1 1

OSD600 Lab3

This week I added two new features to my CLI program.

  1. JSON output support
  2. Good/Bad output support

With the newly added -j argument you the program will compile all the links into a JSON object and print it at the end on the command line.

The new -g/-b arguments allow you to specify to only print good (status 200-299) or bad (status 400-599)

A cool feature I added is that you can combine these two new arguments into something like

python link-check.py -j -g -f urls.txt

Which will only output good urls that are in a JSON object.

In addition this is the first time I have used the 'git merge' command instead of creating pull requests for my projects. It went pretty smoothly but I accidentally created a branch from my completed json branch. This caused MAJOR issues when trying to merge everything to master, I had to deal with a lot of conflict issues. But alas, I fixed them all and got it all pushed in the end with a little bit of 'git revert' magic.

You can view the new and improved version of Link-Check at
https://github.com/MLJBrackett/link-check
ps. You can also check out all the gifs I added to the README.md for the new arguments

You can checkout my issues at

  1. JSON Support: https://github.com/MLJBrackett/link-check/issues/5
  2. -g,-b Support: https://github.com/MLJBrackett/link-check/issues/6

And finally, check out the merges that I made at

  1. JSON Support: https://github.com/MLJBrackett/link-check/commit/29b2563496f220add824f658454bd5d04aa8bf8d
  2. -g,-b Support: https://github.com/MLJBrackett/link-check/commit/2e506df858ecd9d9eebd75209ec407687e8feada

Lesson learned: Don't branch off a feature branch if the new branch doesn't use the new feature.

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay