This is a simple C++ command line application that converts between centimeters and inches.
Build the app using Makefile:
make buildOr directly with g++:
g++ main.cpp -o unit_converterRun the app interactively:
make runOr directly:
./unit_converterAt the prompt, enter commands like:
- cm-to-inch 10
- inch-to-cm 5
- help
- exit
Run all tests:
make testThis will build the app and run the test_app.sh script.
For instructions on forking a repository, see the GitHub Docs.
- Fork this repository on GitHub (click the "Fork" button at the top right of the repo page).
- Create a Codespace from your fork (use the green "Code" button and select "Create codespace on main").
- Add the original repository as an upstream remote:
git remote add upstream https://github.com/leonor-loureiro/codespaces-workshop.git
- Sign in to GitHub Copilot, if not already signed-in:
- Click the Copilot symbol in the status bar (bottom tray) and follow the prompts, or
- Open the Command Palette (press
F1orCtrl+Shift+P), type and select "Copilot: Sign In". - Follow the prompts to authenticate with your GitHub account.
For an introduction to dev containers, see the GitHub Docs.
- Create a
devcontainerconfiguration for the repository using the C++ template. - Rebuild the Codespace to pick up the new config. Use a full rebuild since the base image has changed.
- Add the GitLens extension to the devcontainer.
- Update the
.devcontainer/Dockerfileto install theclang-formatpackage. - Rebuild the container to pick up the changes.
For a quickstart guide to GitHub Copilot, see the GitHub Copilot Quickstart.
- Use Copilot's Ask mode to get an explanation of the current main.cpp file.
- Create a new branch for your changes:
git checkout -b my-feature-branch
- Using Copilot's Edit mode, refactor the command parsing logic for better readability before adding a new command.
- Using the Copilot Agent mode, add a new command to the unit converter CLI app.
- After adding your new command, use Copilot's Review mode to get a code review of your changes and suggestions for improvement.
For instructions on creating a pull request, see the GitHub Docs: Creating a pull request.
- Push your changes to your fork on GitHub.
git push origin my-feature-branch
- Open a pull request from your new branch in your fork to the upstream repository's main branch.
- Follow the prompts to describe your changes and submit the pull request for review.