(subparsers, template)
| 89 | ) |
| 90 | |
| 91 | def generate_sample_help(subparsers, template): |
| 92 | parser = subparsers.add_parser( |
| 93 | template, |
| 94 | help="Generate sample project", |
| 95 | ) |
| 96 | |
| 97 | parser.set_defaults(func=generate_sample(template)) |
| 98 | |
| 99 | parser.add_argument( |
| 100 | "--name", |
| 101 | type=str, |
| 102 | help="Name of the sample project", |
| 103 | default="SampleTest", |
| 104 | ) |
| 105 | |
| 106 | parser.add_argument( |
| 107 | "--category", |
| 108 | type=str, |
| 109 | help="Which category the sample project belongs to", |
| 110 | default="api", |
| 111 | ) |
| 112 | |
| 113 | parser.add_argument( |
| 114 | "--output-dir", |
| 115 | type=str, |
| 116 | help="Output Directory: <project_dir>/samples/<category>", |
| 117 | default=None, |
| 118 | ) |
| 119 | |
| 120 | def prompt_if_path_exists(output_dir, name): |
| 121 | path = os.path.join(output_dir, name) |
no test coverage detected