8000 Write the exit code and the list of names once, and split the output of the subcommands of jetdb-cli into the steps they print by dominion525 · Pull Request #140 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Write the exit code and the list of names once, and split the output of the subcommands of jetdb-cli into the steps they print - #140

Merged
dominion525 merged 2 commits into
mainfrom
refactor/cli
Oct 26, 2026
Merged

dominion525 merged 2 commits into
mainfrom
refactor/cli

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Every subcommand turned its result into an exit code with the same match, in fourteen places, and the four list subcommands printed their names with the same code. The first commit adds exit_code and print_names, which they all use.
  • jetdb schema prints its columns, indexes and relationships in functions of their own, each line aligned by print_aligned, and reads the relationships with a warning when they cannot be read. main sets up the logger and prints where the skill has moved in functions of their own.
  • A form, report, stream or the embedded macros of the type given, or of the only type of the name, are read with read_named, rather than the same match in four places. jetdb prop tells the type of its object, and prints the heading and the properties of each map, in functions of their own, and jetdb export writes an attached file in a function of its own.
  • The output and the exit codes of 3,832 commands over the 120 databases of the test data are the same before and after, character for character: schema, the lists, prop, export, form props, controls and dump, the embedded macros, the macros, --help-skill, no subcommand, and errors.
  • Functions above the thresholds: 49 → 37. Tests: 1115, as before. main is still above them (CC 11), as the match over the nine subcommands; object_type_name and format_value of prop are kept as the matches over the object types and the kinds of values.
Function Before (CC / Cog / SLOC) After, the function of the largest CC
main print_table_schema 21 / 27 / 100 6 / 2 / 29
main run_schema 10 / 11 / 45 8 / 9 / 37
main main 15 / 5 / 53 11 / 3 / 30
form cmd_form 13 / 9 / 32 5 / 1 / 8
form run_props 12 / 4 / 30 6 / 2 / 29
form run_list 11 / 10 / 35 5 / 0 / 15
form form_type_of 11 / 8 / 24 6 / 2 / 16
form run_dump 10 / 1 / 16 8 / 0 / 18
prop print_properties 12 / 15 / 47 8 / 3 / 11
prop run_prop 12 / 2 / 20 8 / 1 / 14
macro run_embedded 11 / 5 / 18 7 / 4 / 20
macro cmd_macro 10 / 2 / 15 5 / 1 / 8
export run_export 11 / 1 / 44 9 / 1 / 41

🤖 Generated with Claude Code

dominion525 and others added 2 commits October 26, 2026 14:13
…e each

- Add exit_code, which writes the error and gives the exit code, used by every subcommand rather than the same match in fourteen places
- Add print_names, which prints a list of names one a line or joined, used by the four list subcommands

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…print

- Print the columns, indexes and relationships of jetdb schema in functions of their own, each line aligned by print_aligned, and read the relationships with a warning when they cannot be read
- Set up the logger and print where the skill has moved in functions of their own
- Read a form, report, stream or embedded macros of the type given or of the only type of the name with read_named, and tell the type of an object of jetdb prop in a function of its own
- Print the heading and the properties of a map of jetdb prop, and write an attached file of jetdb export, in functions of their own

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage

For 04709b8.

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jetdb-cli/src/export.rs            113                11    90.27%           6                 0   100.00%          65                 6    90.77%           0                 0         -
jetdb-cli/src/form.rs              239                19    92.05%          24                 5    79.17%         151                 6    96.03%           0                 0         -
jetdb-cli/src/macro_cmd.rs         117                10    91.45%           7                 2    71.43%          62                 4    93.55%           0                 0         -
jetdb-cli/src/main.rs              910                39    95.71%          82                 4    95.12%         578                28    95.16%           0                 0         -
jetdb-cli/src/prop.rs              322                18    94.41%          37                 2    94.59%         185                 7    96.22%           0                 0         -
jetdb-cli/src/query.rs              65                 3    95.38%           5                 0   100.00%          32                 0   100.00%           0                 0         -
jetdb-cli/src/vba.rs                59                 3    94.92%           5                 0   100.00%          28                 0   100.00%           0                 0         -
jetdb-wasm/src/lib.rs             3871                95    97.55%         252                 4    98.41%        2031                22    98.92%           0                 0         -
jetdb/src/catalog.rs               509                14    97.25%          46                 0   100.00%         299                 3    99.00%           0                 0         -
jetdb/src/complex.rs               924                32    96.54%          73                 0   100.00%         605                15    97.52%           0                 0         -
jetdb/src/crypto.rs               2300               112    95.13%         127                10    92.13%        1315                60    95.44%           0                 0         -
jetdb/src/csv.rs                   857                24    97.20%          72                 0   100.00%         486                 6    98.77%           0                 0        
8000
 -
jetdb/src/data.rs                 4560               179    96.07%         257                 3    98.83%        2564               110    95.71%           0                 0         -
jetdb/src/ddl/access.rs             70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/mod.rs              2771                 8    99.71%         208                 2    99.04%        1501                 6    99.60%           0                 0         -
jetdb/src/ddl/mysql.rs              70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/postgres.rs           71                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/sqlite.rs             69                 0   100.00%           7                 0   100.00%          48                 0   100.00%           0                 0         -
jetdb/src/encoding.rs              284                 0   100.00%          30                 0   100.00%         153                 0   100.00%           0                 0         -
jetdb/src/file.rs                 1915                65    96.61%         117                 0   100.00%         983                18    98.17%           0                 0         -
jetdb/src/form.rs                 3123               128    95.90%         230                10    95.65%        1684                48    97.15%           0                 0         -
jetdb/src/form2000.rs              762                21    97.24%          56                 1    98.21%         402                 4    99.00%           0                 0         -
jetdb/src/format.rs                616                 2    99.68%          45                 0   100.00%         388                 2    99.48%           0                 0         -
jetdb/src/lib.rs                     3                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
jetdb/src/macro_action.rs          299                19    93.65%          27                 3    88.89%         165                24    85.45%           0                 0         -
jetdb/src/macro_def.rs            2440                88    96.39%         196                 9    95.41%        1596                36    97.74%           0                 0         -
jetdb/src/macro_text.rs            804                24    97.01%          54                 2    96.30%         451                20    95.57%           0                 0         -
jetdb/src/map.rs                   416                13    96.88%          27                 0   100.00%         221                 5    97.74%           0                 0         -
jetdb/src/money.rs                 281                 0   100.00%          26                 0   100.00%         186                 0   100.00%           0                 0         -
jetdb/src/prop.rs                 1375                18    98.69%          90                 0   100.00%         695                10    98.56%           0                 0         -
jetdb/src/query.rs                2514                62    97.53%         200                 1    99.50%        1550                18    98.84%           0                 0         -
jetdb/src/relationship.rs          249                26    89.56%          22                 0   100.00%         177                10    94.35%           0                 0         -
jetdb/src/save_as_text.rs          574                27    95.30%          52                 3    94.23%         341                27    92.08%           0                 0         -
jetdb/src/storage.rs               764                32    95.81%          57                 0   100.00%         434                 6    98.62%           0                 0         -
jetdb/src/table.rs                1679                67    96.01%         109                 2    98.17%        1017                18    98.23%           0                 0         -
jetdb/src/timestamp.rs             405                 0   100.00%          44                 0   100.00%         235                 0   100.00%           0                 0         -
jetdb/src/vba.rs                   649                57    91.22%          62                12    80.65%         354                23    93.50%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            37049              1216    96.72%        2674                75    97.20%       21123               542    97.43%           0                 0         -

@dominion525
dominion525 merged commit 809c035 into main Oct 26, 2026
11 checks passed
@dominion525
dominion525 deleted the refactor/cli branch October 26, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0