Skip to content

Add argument for path to pico_configs file #27

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

Merged
merged 5 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It will also add example code for any features and optionally for some standard
Running `./pico_project --help` will give a list of the available command line parameters

```
usage: pico_project.py [-h] [-o OUTPUT] [-x] [-l] [-c] [-f FEATURE] [-over] [-b] [-g] [-p PROJECT] [-r] [-uart] [-usb] [name]
usage: pico_project.py [-h] [-t TSV] [-o OUTPUT] [-x] [-l] [-c] [-f FEATURE] [-over] [-b] [-g] [-p PROJECT] [-r] [-uart] [-usb] [name]

Pico Project generator

Expand All @@ -20,6 +20,7 @@ positional arguments:

optional arguments:
-h, --help show this help message and exit
-t TSV, --tsv TSV Select an alternative pico_configs.tsv file
-o OUTPUT, --output OUTPUT
Set an alternative CMakeList.txt filename
-x, --examples Add example code for the Pico standard library
Expand Down
3 changes: 2 additions & 1 deletion pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ def CheckSDKPath(gui):
def ParseCommandLine():
parser = argparse.ArgumentParser(description='Pico Project generator')
parser.add_argument("name", nargs="?", help="Name of the project")
parser.add_argument("-t", "--tsv", help="Select an alternative pico_configs.tsv file", default="pico_configs.tsv")
parser.add_argument("-o", "--output", help="Set an alternative CMakeList.txt filename", default="CMakeLists.txt")
parser.add_argument("-x", "--examples", action='store_true', help="Add example code for the Pico standard library")
parser.add_argument("-l", "--list", action='store_true', help="List available features")
Expand Down Expand Up @@ -1101,7 +1102,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger):

def LoadConfigurations():
try:
with open("pico_configs.tsv") as tsvfile:
with open(args.tsv) as tsvfile:
reader = csv.DictReader(tsvfile, dialect='excel-tab')
for row in reader:
configuration_dictionary.append(row)
Expand Down