Skip to content

VG-dev1/preset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preset

Version info GitHub Actions Workflow Status Crates.io Total Downloads Crates.io License

preset is a program for managing and running command sequences at once, so you don't have to manually type your commands - just append them to your preset and run your preset.

InstallationUsage

Features

  • Create, delete and manage your presets
  • Run your presets
  • Placeholders for flexible values (user input)
  • JSON saving
  • Debugging messages

Demo

Demo

Usage

Create a preset

Your first step is to create your preset. You can do that by running preset create, followed by your preset's name:

preset create test

Append commands

After creating a preset, you need to add your commands to it. You can do that by running preset append, followed by your preset's name and a command:

preset append test echo Hi!
preset append test echo This is a test!

Placeholders

Normally, the appended commands's value is fixed (e.g. echo Hi!). You can make a value flexible (make a preset ask for input when it reaches that command) by adding a placeholder {}:

preset append test echo {}

Run a preset

Finally, you can run your preset by running preset run, followed by your preset's name:

preset run test

You can also disable debugging messages using the --no-message flag.

And, you can preview what would be ran without actually running commands using the --dry-run flag.

Note

If a command returns non-zero, the preset will crash. To keep the preset running despite a failed command, use the --skip-errors flag.

Remove commands

You can remove a specific command from your preset by running preset remove, followed by your preset's name and a command:

preset remove test echo Hi!

Pop commands at a given index

You can pop a command from your preset at a given index by running preset pop, followed by your preset's name and an index:

preset pop test 0

Insert commands

You can insert a command at a given index by running preset insert, followed by your preset's name, index and command:

preset insert test 0 echo Hi!

Listing presets

You can see all of your created presets by running preset list:

preset list

This prints the pretty JSON where all of your created presets are saved.

Installation

From source

cargo install preset

Licence

This project is distributed under the MIT License.