Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Latest commit

 

History

History
85 lines (52 loc) · 2.02 KB

quickstart.rst

File metadata and controls

85 lines (52 loc) · 2.02 KB

Basics

RKD command-line usage is highly inspired by GNU Make and Gradle, but it has its own extended possibilities to make your scripts smaller and more readable.

  • Tasks are prefixed always with ":".
  • Each task can handle it's own arguments (unique in RKD)
  • "@" allows to propagate arguments to next tasks (unique in RKD)

Tasks arguments usage in shell and in scripts

Executing multiple tasks in one command:

rkd :task1 :task2

Multiple tasks with different switches:

rkd :task1 --hello  :task2 --world

Tasks sharing the same switches

Both tasks will receive switch "--hello"

# expands to:
#  :task1 --hello
#  :task2 --hello
rkd @ --hello :task1 :task2

# handy, huh?

Advanced usage of shared switches

Operator "@" can set switches anytime, it can also clear or replace switches in NEXT TASKS.

# expands to:
#   :task1 --hello
#   :task2 --hello
#   :task3
#   :task4 --world
#   :task5 --world
rkd @ --hello :task1 :task2 @ :task3 @ --world :task4 :task5

Written as a pipeline (regular bash syntax)

It's exactly the same example as above, but written multiline. It's recommended to write multiline commands if they are longer.

rkd @ --hello \
    :task1 \
    :task2 \
    @
    :task3 \
    @ --world \
    :task4 \
    :task5

YAML syntax - makefile.yaml

YAML syntax has an advantage of simplicity and clean syntax, custom bash tasks can be defined there easier than in Python. To use YAML you need to define makefile.yaml file in .rkd directory.

NOTICE: makefile.py and makefile.yaml can exist together. Python version will be loaded first, the YAML version will append changes in priority.

../examples/yaml/.rkd/makefile.yaml

What's loaded first? See Path and inheritance