Skip to content
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

Refine parameter help #127

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Refine parameter help #127

merged 5 commits into from
Jul 13, 2023

Conversation

schlusslicht
Copy link
Member

@schlusslicht schlusslicht commented Jul 10, 2023

This pull request is inspired by, contains and supersedes #123.

Inspired by the pull request opened by @Querela, this pull request contains minimal docstrings for all kosh.params which will be displayed when calling the kosh python entrypoint with the --help parameter. It further refines the implementation provided by the pull request #123 to include not only values of parameters specified on the CLI together with the --help parameter, but all available (as in default) parameter values. Last but not least, the commit f340866 drops the "".format() string formatting function in favour of literal string interpolation (f"").

@schlusslicht schlusslicht self-assigned this Jul 10, 2023
@schlusslicht
Copy link
Member Author

schlusslicht commented Jul 10, 2023

Output:

# kosh --help
2023-07-11 15:15:13 [INFO] <kosh.kosh> Started kosh with pid 297
2023-07-11 15:15:13 [INFO] <kosh.kosh> Loaded API endpoint modules ['graphql', 'restful']
kosh - APIs for Lexical Data
----------------------------

Parameters:
    --api_port     The port kosh will listen on (set to: 5000)
    --api_root     The API context path kosh will serve (set to: /api)
    --config_file  The configuration file kosh will use 
    --config_text  Arbitrary configuration values kosh will use 
    --data_host    The Elasticsearch host kosh will use (set to: 127.0.0.1)
    --data_pool    String prefix to pool all Elasticsearch indices together (set to: kosh)
    --data_root    The path to XML lexical data with kosh files (set to: /var/lib/kosh)
    --data_sync    The interval in which files are checked for changes (set to: 10)
    --help         Show this help and list available parameters 
    --log_file     Specifies the the file kosh will log to 
    --log_level    Specifies the kosh logger level (set to: INFO)

Loaded API endpoint modules:
    graphql - A GraphQL endpoint serving lexical data
    restful - A RESTful endpoint serving lexical data

@schlusslicht
Copy link
Member Author

Rebased against current master.

Copy link
Collaborator

@lguenth lguenth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and everything seems to work as expected with the help parameter itself. It correctly reads values from the config as well, so I'll approve and merge.
As a side note though, while trying to test each parameter again, I think I found a problem with the data_sync setting. I'll open an issue and tag you.

@lguenth lguenth merged commit c64239d into master Jul 13, 2023
@schlusslicht schlusslicht deleted the helparam branch July 14, 2023 08:16
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.

3 participants