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

Generate help from CLI #9

Closed
blcham opened this issue Mar 7, 2022 · 2 comments
Closed

Generate help from CLI #9

blcham opened this issue Mar 7, 2022 · 2 comments

Comments

@blcham
Copy link
Contributor

blcham commented Mar 7, 2022

When script is run without parameters or with bad parameters or with --help, information about parameters should be shown. It should return similar input as following bash script:

if [ $# -lt 4 ];
then
        echo "ERROR: all 4 parameters should be passed";

        echo "Usage: bpmn2stamp.sh <bpmn_file> <actor_mapping_xml> <organization_structure_xml> <result_ontology_base_iri>"
        echo "where:"
        echo "  bpmn_file - bpmn file to convert"
        echo "  actor_mapping_xml - actor mapping file for bpmn processes"
        echo "  organization_structure_xml - organization structure file"
        echo "  result_ontology_base_iri - base iri for the output ontology"

        exit 1;
fi;

echo "Passed parameters:"
echo "  bpmn_file = "$bpmn_file
echo "  actor_mapping_xml = "$actor_mapping
echo "  organization_structure_xml = "$organization_structure
echo "  result_ontology_base_iri = "$base_iri
echo "  output ontology file name (automatically derived from bpmn_xml) = "$output_file

echo ""
echo "Executing bpmn2stamp converter (using stamp execution stamp - see converter documentation):"
echo "-------------------------------------------------------------------------------------------------------"
echo "java -jar bpmn2stamp.jar -t stamp -iam \"$actor_mapping\" -ibpmn \"$bpmn_file\" -iorg \"$organization_structure\" -iri \"$base_iri\" -o \"$output_file\""

A/C:

  • generated help is outputted to the console if CLI is incorrectly used
@blcham blcham added this to To do in Convertor 1.0 via automation Mar 7, 2022
@blcham
Copy link
Contributor Author

blcham commented Mar 8, 2022

@grigobog
BTW, I have read your code to process CLI arguments and not sure it must be that complicated, on next meeting I will explain how parsing with org.kohsuke.args4j works:
https://github.com/kbss-cvut/s-pipes/blob/main/s-pipes-cli/src/main/java/cz/cvut/spipes/cli/ExecuteModuleCLI.java

@grigobog
Copy link
Collaborator

@grigobog grigobog moved this from To do to In progress in Convertor 1.0 Mar 21, 2022
@blcham blcham closed this as completed Mar 21, 2022
Convertor 1.0 automation moved this from In progress to Done Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants