Skip to content

Commit

Permalink
docs: add small section about xonsh and fix old style documentation (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijeetSaroha authored Nov 16, 2023
1 parent 08fc275 commit 08faa00
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This is an example of a configuration file:
```yaml
version: 1.0.0
groups:
- name: default
default:
env-file: .env
targets:
clean:
Expand Down Expand Up @@ -107,3 +107,57 @@ If you have any problem, open an issue at: https://github.com/osl-incubator/maki

As you can see, the help menu automatically adds information defined by all
the `help` key, inside the `.makim.yaml` file.

## Xonsh Shell Integration

### What is Xonsh?
[Xonsh](https://xon.sh/) is a powerful shell language and command prompt designed to
seamlessly blend traditional shell capabilities with the expressive syntax of Python.
It offers an interactive and extensible environment that enables users to transition
effortlessly between standard shell commands and Python scripting.

### How Xonsh enhances this Project?
In the context of this project, Xonsh serves as the default shell for executing commands
defined in the Makim configuration. By leveraging Xonsh, the Makim tool gains the flexibility
and richness of the Python programming language within a command-line interface. This integration
allows users to create sophisticated tasks and harness the full power of Python directly
in the terminal.

### Key Features and Commands in Xonsh
1. **Unified Syntax :** Xonsh seamlessly integrates traditional shell syntax with Python's
clean and expressive syntax, creating a unified and consistent scripting experience.
```
# Shell-style command
ls -l

# Python-style variable assignment
$filename = "example.txt"

# Combining both in a single command
echo "The contents of $filename are: $(cat $filename)"
```
2. **Python Variables and Expressions :** Python variables can be easily incorporated into
commands, enhancing the readability and flexibility of your scripts.
```
$filename = "example.txt"
echo "The filename is $filename"
```
3. **Looping and Conditional Statements :** Use Python-style loops and conditionals to create
dynamic and complex command sequences.
```
for $i in range(3):
echo "Iteration $i"
```
4. **Extensible Tab Completion :** Xonsh offers extensible and intelligent tab completion,
making it easier to discover and complete commands and variables.
```
$long_variable_name = "some_value"
echo $long_<TAB>
# Xonsh will intelligently complete the variable name
```
For more comprehensive information and documentation, explore the [Xonsh GitHub repository]
(https://github.com/xonsh/xonsh) and the official [Xonsh website](https://xon.sh/).

0 comments on commit 08faa00

Please sign in to comment.