Open ahnaf-tahmid-chowdhury opened 4 weeks ago
just to check i understand can you give an example of what the user would provide for the full module name
thanks
When the user types openmc
/openmc-data
and presses Tab, they would see all the primary subcommands:
openmc <TAB>
convert generate download chain help
Once the user selects a subcommand (e.g., convert
), pressing Tab again will show the libraries available for conversion:
openmc convert <TAB>
mcnp70 mcnp71 endf lib80x jeff32 jeff33 fendl tendl
When the user selects a specific library, pressing Tab will reveal relevant flags or arguments. For example:
openmc convert endf <TAB>
-d --destination -p --particles --download --no-download --cleanup --help
Start with the base command:
openmc <TAB>
Output:
convert generate download chain help
Select a subcommand (e.g., convert
):
openmc convert <TAB>
Output:
mcnp70 mcnp71 endf lib80x jeff32 jeff33 fendl tendl
Select a library (e.g., endf
):
openmc convert endf <TAB>
Output:
-d --destination -p --particles --download --no-download --cleanup --help
Add a flag (e.g., -d
for destination):
openmc convert endf -d <path>
To achieve this, we will need libraries like argparse
(Python) or click
, which are compatible with generating shell completion scripts.
The code uses argparse at the moment Also when the user does pip install then they already get access to cli commands so they don't have to type openmc/...
Perhaps I've miss understood
Thank you for the clarification! The current version has multiple base commands like convert_mcnp70
, convert_mcnp71
, etc. I suggest consolidating these under a single base command, such as openmc-data <others>
. This change would simplify usage and enhance the user experience, allowing for a cleaner command structure.
Ah yes I understand now. Yes that is something I would be keen to see.
Description
Currently, the scripts in the this repository require the full module name to be specified when invoking conversions or generations. This can be cumbersome and may lead to errors in typing.
Proposal
I suggest implementing a Command Line Interface (CLI) that allows users to invoke each module based on arguments instead of needing to specify the full module name. This would streamline the process and enhance user experience.
Benefits