Skip to content

Commit 155ac83

Browse files
ischneidercp16net
authored andcommitted
fix cli reference doc generation, flags have dash
replace code_name underscores to get flag-style
1 parent f7e07c0 commit 155ac83

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

docs/source/cli/reference.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ General Options
9999

100100

101101

102-
``--api_key``
102+
``--api-key``
103103
Valid API key - or via ENV variable PL_API_KEY
104104

105105

106106

107-
``--base_url``
107+
``--base-url``
108108
Change the base Planet API URL or ENV PL_API_BASE_URL - Default https://api.planet.com/
109109

110110

@@ -235,7 +235,7 @@ Usage: create-search [OPTIONS]
235235

236236
- TEXT
237237

238-
* - asset_type
238+
* - asset-type
239239
- Specify asset type(s) permissions
240240

241241
- :ref:`cli-metavar-asset-type`
@@ -245,12 +245,12 @@ Usage: create-search [OPTIONS]
245245

246246
- FIELD ORDER...
247247

248-
* - item_type
248+
* - item-type
249249
- Specify item type(s)
250250

251251
- :ref:`cli-metavar-item-type`
252252

253-
* - filter_json
253+
* - filter-json
254254
- Use the specified filter
255255

256256
DEFAULT: `@-`
@@ -261,12 +261,12 @@ Usage: create-search [OPTIONS]
261261

262262
- :ref:`cli-metavar-geom`
263263

264-
* - string_in
264+
* - string-in
265265
- Filter field by string in.
266266

267267
- :ref:`cli-metavar-field-values`
268268

269-
* - number_in
269+
* - number-in
270270
- Filter field by numeric in.
271271

272272
- :ref:`cli-metavar-field-values`
@@ -319,17 +319,17 @@ Usage: download [OPTIONS]
319319

320320
- BOOLEAN
321321

322-
* - activate_only
322+
* - activate-only
323323
- Only activate the items. Outputs URLS for downloading.
324324

325325
- BOOLEAN
326326

327-
* - dry_run
327+
* - dry-run
328328
- Only report the number of items that would be downloaded.
329329

330330
- BOOLEAN
331331

332-
* - search_id
332+
* - search-id
333333
- Use the specified search
334334

335335
- TEXT
@@ -344,12 +344,12 @@ Usage: download [OPTIONS]
344344

345345
- :ref:`cli-metavar-field-comp-value`
346346

347-
* - number_in
347+
* - number-in
348348
- Filter field by numeric in.
349349

350350
- :ref:`cli-metavar-field-values`
351351

352-
* - string_in
352+
* - string-in
353353
- Filter field by string in.
354354

355355
- :ref:`cli-metavar-field-values`
@@ -359,13 +359,13 @@ Usage: download [OPTIONS]
359359

360360
- :ref:`cli-metavar-geom`
361361

362-
* - filter_json
362+
* - filter-json
363363
- Use the specified filter
364364

365365
DEFAULT: `@-`
366366
- :ref:`cli-metavar-filter`
367367

368-
* - item_type
368+
* - item-type
369369
- Specify item type(s)
370370

371371
- :ref:`cli-metavar-item-type`
@@ -375,7 +375,7 @@ Usage: download [OPTIONS]
375375

376376
- FIELD ORDER...
377377

378-
* - asset_type
378+
* - asset-type
379379
- Specify asset type(s)
380380

381381
- :ref:`cli-metavar-asset-type`
@@ -407,7 +407,7 @@ Usage: filter [OPTIONS]
407407

408408
- Format
409409

410-
* - filter_json
410+
* - filter-json
411411
- Use the specified filter
412412

413413
DEFAULT: `@-`
@@ -418,12 +418,12 @@ Usage: filter [OPTIONS]
418418

419419
- :ref:`cli-metavar-geom`
420420

421-
* - string_in
421+
* - string-in
422422
- Filter field by string in.
423423

424424
- :ref:`cli-metavar-field-values`
425425

426-
* - number_in
426+
* - number-in
427427
- Filter field by numeric in.
428428

429429
- :ref:`cli-metavar-field-values`
@@ -509,7 +509,7 @@ Usage: search [OPTIONS]
509509

510510
- BOOLEAN
511511

512-
* - asset_type
512+
* - asset-type
513513
- Specify asset type(s) permissions
514514

515515
- :ref:`cli-metavar-asset-type`
@@ -519,12 +519,12 @@ Usage: search [OPTIONS]
519519

520520
- FIELD ORDER...
521521

522-
* - item_type
522+
* - item-type
523523
- Specify item type(s)
524524

525525
- :ref:`cli-metavar-item-type`
526526

527-
* - filter_json
527+
* - filter-json
528528
- Use the specified filter
529529

530530
DEFAULT: `@-`
@@ -535,12 +535,12 @@ Usage: search [OPTIONS]
535535

536536
- :ref:`cli-metavar-geom`
537537

538-
* - string_in
538+
* - string-in
539539
- Filter field by string in.
540540

541541
- :ref:`cli-metavar-field-values`
542542

543-
* - number_in
543+
* - number-in
544544
- Filter field by numeric in.
545545

546546
- :ref:`cli-metavar-field-values`
@@ -626,12 +626,12 @@ Usage: stats [OPTIONS]
626626

627627
- :ref:`cli-metavar-field-comp-value`
628628

629-
* - number_in
629+
* - number-in
630630
- Filter field by numeric in.
631631

632632
- :ref:`cli-metavar-field-values`
633633

634-
* - string_in
634+
* - string-in
635635
- Filter field by string in.
636636

637637
- :ref:`cli-metavar-field-values`
@@ -641,13 +641,13 @@ Usage: stats [OPTIONS]
641641

642642
- :ref:`cli-metavar-geom`
643643

644-
* - filter_json
644+
* - filter-json
645645
- Use the specified filter
646646

647647
DEFAULT: `@-`
648648
- :ref:`cli-metavar-filter`
649649

650-
* - item_type
650+
* - item-type
651651
- Specify item type(s)
652652

653653
- :ref:`cli-metavar-item-type`
@@ -657,7 +657,7 @@ Usage: stats [OPTIONS]
657657

658658
- FIELD ORDER...
659659

660-
* - asset_type
660+
* - asset-type
661661
- Specify asset type(s) permissions
662662

663663
- :ref:`cli-metavar-asset-type`

docs/source/generate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def param_block(e, cmd):
5959
desc = p.help
6060
if p.default:
6161
desc = desc + '\nDEFAULT: `%s`' % p.default
62-
list_row(e, (p.name, desc, link))
62+
flag = p.name.replace('_', '-')
63+
list_row(e, (flag, desc, link))
6364

6465

6566
def generate_cli_reference(e):
@@ -90,7 +91,8 @@ def generate_cli_reference(e):
9091

9192
e.e(h('General Options'))
9293
for p in scripts.main.params:
93-
e.e('``--%s``\n %s\n\n' % (p.name, p.help))
94+
flag = p.name.replace('_', '-')
95+
e.e('``--%s``\n %s\n\n' % (flag, p.help))
9496

9597
generate_command_section(e, 'General Commands', general)
9698
generate_command_section(e, 'Data API', groups[0].commands.values())

0 commit comments

Comments
 (0)