Skip to content

Commit af37d4b

Browse files
committed
Add --format=json option to listings
1 parent c9f93a0 commit af37d4b

28 files changed

Lines changed: 559 additions & 71 deletions

docs/yamcs_alarms.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Synopsis
99
.. rst-class:: synopsis
1010

1111
| **yamcs alarms** list [--processor <*PROCESSOR*>]
12+
| [--format <*FORMAT*>]
1213
| **yamcs alarms** acknowledge [--processor <*PROCESSOR*>]
1314
| [-c <*COMMENT*>, --comment <*COMMENT*>] <*ALARM*> <*SEQNO*>
1415
| **yamcs alarms** shelve [--processor <*PROCESSOR*>]
@@ -19,6 +20,7 @@ Synopsis
1920
| [-c <*COMMENT*>, --comment <*COMMENT*>] <*ALARM*> <*SEQNO*>
2021
| **yamcs alarms** log [-n <*LINES*>, --lines <*LINES*>]
2122
| [-s <*DATE*>, --since <*DATE*>] [-u <*DATE*>, --until <*DATE*>]
23+
| [--format <*FORMAT*>]
2224
2325

2426
Description
@@ -30,7 +32,7 @@ Manage alarms.
3032
Commands
3133
--------
3234

33-
.. describe:: list [--processor <PROCESSOR>]
35+
.. describe:: list [--processor <PROCESSOR>] [--format <FORMAT>]
3436

3537
Show active alarms
3638

@@ -50,7 +52,7 @@ Commands
5052

5153
Clear an alarm
5254

53-
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>]
55+
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--format <FORMAT>]
5456

5557
Read alarm log
5658

@@ -94,6 +96,15 @@ Options
9496

9597
The date should be specified in ISO format or as detailed under `Timestamps`_.
9698

99+
.. option:: --format <FORMAT>
100+
101+
For subcommands that support it, set the output format to:
102+
103+
``table``
104+
Print a human-friendly table
105+
``json``
106+
Print in JSON format
107+
97108

98109
Timestamps
99110
----------

docs/yamcs_algorithms.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs algorithms** list
11+
| **yamcs algorithms** list [--format <*FORMAT*>]
1212
| **yamcs algorithms** describe <*ALGORITHM*>
1313
1414

@@ -23,8 +23,21 @@ Commands
2323

2424
.. describe:: list
2525

26-
List algorithms
26+
List algorithms [--format <FORMAT>]
2727

2828
.. describe:: describe <ALGORITHM>
2929

3030
Describe an algorithm
31+
32+
33+
Options
34+
-------
35+
36+
.. option:: --format <FORMAT>
37+
38+
For subcommands that support it, set the output format to:
39+
40+
``table``
41+
Print a human-friendly table
42+
``json``
43+
Print in JSON format

docs/yamcs_commands.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs commands** list
11+
| **yamcs commands** list [--format <*FORMAT*>]
1212
| **yamcs commands** describe <*COMMAND*>
1313
| **yamcs commands** run [--stream <*STREAM*>] [--processor <*PROCESSOR*>]
1414
| [--dry-run] [--sequence-number <*SEQNO*>] [--arg-file <*FILE*>]
1515
| [--arg <*KEY=VALUE*> [<*KEY=VALUE*> ...]]
1616
| <*COMMAND*>
1717
| **yamcs commands** log [-n <*LINES*>, --lines <*LINES*>]
1818
| [-s <*DATE*>, --since <*DATE*>] [-u <*DATE*>, --until <*DATE*>]
19+
| [--format <*FORMAT*>]
20+
1921

2022
Description
2123
-----------
@@ -26,7 +28,7 @@ Manage commands.
2628
Commands
2729
--------
2830

29-
.. describe:: list
31+
.. describe:: list [--format <FORMAT>]
3032

3133
List commands
3234

@@ -38,7 +40,7 @@ Commands
3840

3941
Run a command
4042

41-
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>]
43+
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--format <FORMAT>]
4244

4345
Read command log
4446

@@ -92,6 +94,15 @@ Options
9294

9395
The date should be specified in ISO format or as detailed under `Timestamps`_.
9496

97+
.. option:: --format <FORMAT>
98+
99+
For subcommands that support it, set the output format to:
100+
101+
``table``
102+
Print a human-friendly table
103+
``json``
104+
Print in JSON format
105+
95106

96107
Timestamps
97108
----------

docs/yamcs_containers.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs containers** list
11+
| **yamcs containers** list [--format <*FORMAT*>]
1212
| **yamcs containers** describe <*CONTAINER*>
1313
1414

@@ -28,3 +28,16 @@ Commands
2828
.. describe:: describe <CONTAINER>
2929

3030
Describe a container
31+
32+
33+
Options
34+
-------
35+
36+
.. option:: --format <FORMAT>
37+
38+
For subcommands that support it, set the output format to:
39+
40+
``table``
41+
Print a human-friendly table
42+
``json``
43+
Print in JSON format

docs/yamcs_events.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Synopsis
1313
| [--type <*TYPE*>] [--extra <*KEY=VALUE*> [<*KEY=VALUE*> ...]]
1414
| **yamcs events** log [-n <*LINES*>, --lines <*LINES*>]
1515
| [-s <*DATE*>, --since <*DATE*>] [-u <*DATE*>, --until <*DATE*>]
16-
| [--filter <*EXPRESSION*>]
16+
| [--filter <*EXPRESSION*>] [--format <*FORMAT*>]
1717
1818
Description
1919
-----------
@@ -28,7 +28,7 @@ Commands
2828

2929
Create an event. This command shows an editor where you can enter the event message. Alternatively you can specify the message using the ``--message`` option.
3030

31-
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--filter <EXPRESSION>]
31+
.. describe:: log [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--filter <EXPRESSION>] [--format <FORMAT>]
3232

3333
Read event log
3434

@@ -91,6 +91,14 @@ Options
9191

9292
With ``log``, include events that match the filter expression.
9393

94+
.. option:: --format <FORMAT>
95+
96+
For subcommands that support it, set the output format to:
97+
98+
``table``
99+
Print a human-friendly table
100+
``json``
101+
Print in JSON format
94102

95103
Timestamps
96104
----------

docs/yamcs_instances.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs instances** list
11+
| **yamcs instances** list [--format <*FORMAT*>]
1212
| **yamcs instances** start <*INSTANCE*>...
1313
| **yamcs instances** stop <*INSTANCE*>...
1414
@@ -22,7 +22,7 @@ Read Yamcs instances.
2222
Commands
2323
--------
2424

25-
.. describe:: list
25+
.. describe:: list [--format <FORMAT>]
2626

2727
List instances
2828

@@ -33,3 +33,16 @@ Commands
3333
.. describe:: stop <INSTANCE>...
3434

3535
Stop an instance
36+
37+
38+
Options
39+
-------
40+
41+
.. option:: --format <FORMAT>
42+
43+
For subcommands that support it, set the output format to:
44+
45+
``table``
46+
Print a human-friendly table
47+
``json``
48+
Print in JSON format

docs/yamcs_links.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs links** list
11+
| **yamcs links** list [--format <*FORMAT*>]
1212
| **yamcs links** enable <*LINK*>...
1313
| **yamcs links** disable <*LINK*>...
1414
| **yamcs links** describe <*LINK*>
@@ -24,7 +24,7 @@ Read and manipulate data links.
2424
Commands
2525
--------
2626

27-
.. describe:: list
27+
.. describe:: list [--format <FORMAT>]
2828

2929
List links
3030

@@ -43,3 +43,16 @@ Commands
4343
.. describe:: run-action
4444

4545
Run a custom action
46+
47+
48+
Options
49+
-------
50+
51+
.. option:: --format <FORMAT>
52+
53+
For subcommands that support it, set the output format to:
54+
55+
``table``
56+
Print a human-friendly table
57+
``json``
58+
Print in JSON format

docs/yamcs_packets.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Synopsis
1111
| **yamcs packets** log [-p <*PACKET*>, --packet <*PACKET*>]
1212
| [-n <*LINES*>, --lines <*LINES*>] [-s <*DATE*>, --since <*DATE*>]
1313
| [-u <*DATE*>, --until <*DATE*>] [--filter <*EXPRESSION*>]
14+
| [--format <*FORMAT*>]
1415
| **yamcs packets** rebuild-histogram [-s <*DATE*>, --since <*DATE*>]
1516
| [-u <*DATE*>, --until <*DATE*>]
1617
| **yamcs packets** rebuild-ccsds-index [-s <*DATE*>, --since <*DATE*>]
@@ -25,7 +26,7 @@ Read packets.
2526
Commands
2627
--------
2728

28-
.. describe:: log [-p <PACKET> --packet <PACKET>] [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--filter <EXPRESSION>]
29+
.. describe:: log [-p <PACKET> --packet <PACKET>] [-n <LINES>, --lines <LINES>] [-s <DATE>, --since <DATE>] [-u <DATE>, --until <DATE>] [--filter <EXPRESSION>] [--format <FORMAT>]
2930

3031
Read packet log
3132

@@ -69,6 +70,15 @@ Options
6970

7071
With ``log``, include packets that match the filter expression.
7172

73+
.. option:: --format <FORMAT>
74+
75+
For subcommands that support it, set the output format to:
76+
77+
``table``
78+
Print a human-friendly table
79+
``json``
80+
Print in JSON format
81+
7282

7383
Timestamps
7484
----------

docs/yamcs_parameters.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs parameters** list
11+
| **yamcs parameters** list [--format <*FORMAT*>]
1212
| **yamcs parameters** describe <*PARAMETER*>
1313
| **yamcs parameters** get [--next [--timeout <*TIMEOUT*>]] <*PARAMETER*>
1414
| **yamcs parameters** set [--date <*DATE*>] <*PARAMETER*> <*VALUE*>
@@ -25,7 +25,7 @@ Manage parameters.
2525
Commands
2626
--------
2727

28-
.. describe:: list
28+
.. describe:: list [--format <FORMAT>]
2929

3030
List parameters
3131

@@ -87,6 +87,15 @@ Options
8787

8888
The date should be specified in ISO format or as detailed under `Timestamps`_.
8989

90+
.. option:: --format <FORMAT>
91+
92+
For subcommands that support it, set the output format to:
93+
94+
``table``
95+
Print a human-friendly table
96+
``json``
97+
Print in JSON format
98+
9099

91100
Timestamps
92101
----------

docs/yamcs_processors.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Synopsis
88

99
.. rst-class:: synopsis
1010

11-
| **yamcs processors** list
11+
| **yamcs processors** list [--format <*FORMAT*>]
1212
| **yamcs processors** delete <*PROCESSOR*>
1313
1414

@@ -21,10 +21,23 @@ Manage processors.
2121
Commands
2222
--------
2323

24-
.. describe:: list
24+
.. describe:: list [--format <FORMAT>]
2525

2626
List processors
2727

2828
.. describe:: delete <PROCESSOR>
2929

3030
Delete a processor
31+
32+
33+
Options
34+
-------
35+
36+
.. option:: --format <FORMAT>
37+
38+
For subcommands that support it, set the output format to:
39+
40+
``table``
41+
Print a human-friendly table
42+
``json``
43+
Print in JSON format

0 commit comments

Comments
 (0)