Yomel revolutionizes shell scripting by offering an extremely readable and debuggable command tool inspired by YAML syntax. It enhances clarity, allowing for better maintenance and understanding of scripts, while providing structured logs for seamless debugging. Say goodbye to cryptic shell commands.
yomel is an innovative shell pipeline command tool designed to enhance readability and debuggability of shell scripts, utilizing a YAML-like syntax. This project aims to address common struggles associated with traditional shell scripting, such as poor readability and difficult debugging, making the process smoother and more intuitive.
Enhanced Readability: yomel transforms complex shell commands into a more structured and easily readable format, similar to YAML. This allows developers to quickly grasp the intent and structure of their commands.
Improved Debugging: yomel provides comprehensive and structured logs for shell pipelines, reducing the hassles typically associated with debugging. This feature ensures that important logs are easily accessible without cluttering the standard output.
Traditional shell scripts can often be verbose and challenging to understand. For instance, a complex command might resemble:
step_num=$(\
find \
"/home/xbabu/Desktop/share/temp/exp_py_for_yomel" \
-name "*.py" \
-type "f" \
| xargs wc -l \
| sort -nr \
| head -1 \
| sed 's/[^0-9]//g' \
);\
echo "${step_num}"
In contrast, using yomel, the same operation becomes much clearer:
step_num=$(yomel \
title "aggregate py step count" \
stage "find py file" \
-cmd find \
--argFindDir "/home/xbabu/Desktop/share/temp/exp_py_for_yomel" \
--optFilterFileName name \
--valOnlyPyExtend "*.py" \
--optFilterType type \
--valFile f \
stage "count step num by each py file" \
-cmd xargs \
--argCountCmd --n "wc -l" \
stage "sort numerically in descending order" \
--log \
-cmd sort \
--optNumerically n \
--optDescendingOrder r \
stage "get only first total line" \
--log \
-cmd head \
--optOnlyFirstLine 1 \
stage "get only step num" \
--log \
-cmd sed \
--argSubstitute --s 's/[^0-9]//g' \
);\
echo "total ${step_num}"
This formatted approach, with clear titles and stages, enhances understanding and maintainability of the code.
yomel also excels in providing detailed logs that help visualize the pipeline's execution:
yomel allow users to identify and troubleshoot errors swiftly, as all logs flow through stderr without affecting standard output. This flexibility enables debris-free shell pipelines that are clean and efficient.To appreciate the capabilities of yomel, a demo can be found showcasing its features and applications in real-world scenarios.
By leveraging the strengths of yomel, developers can significantly enhance their shell scripting experience, producing scripts that are not only user-friendly but also easier to debug and maintain.
No comments yet.
Sign in to be the first to comment.