rox-cli 0.1.0

A YAML-Defined CLI for Dev Tools
# This is an ideal end-state for functionality

# Other files can be combined, but watch out for overwriting identical target names!
supplemental_files: ["someotherfile.yml"]

# If this isn't true, requirments won't be checked before running the target(s)
always_check_requirements: true 

# These checks require a single, well-formed SemVer version string as output from the command
version_requirements:
  - command: "docker version --format {{.Client.Version}}" # 20.10.23
    minimum_version: "20.10.7"
    maximum_version: "21.0.0"

  - command: "python --version" # Python 3.9.13
    # Splits on spaces and grabs the last output token,
    # useful for avoiding bash manipulation of output
    split: true 
    minimum_version: "3.8"

file_requirements: # Verify that these files exist
  - path: "Cargo.toml"
  
  - path: "example_rox.yml"
    create_if_not_exists: true # Create the file if it doesn't exist 

targets:

  #------------------------------------------------
  # This section is for unimplemented functionality
  #------------------------------------------------
  # Run only the specified params, errors if no match
  # rox docker_build -foo prod
  - name: cargo
    parameters:
      - symbol: foo # Rox will look for and replace $foo in both the command and arguments
        values: ["fmt", "clippy", "test"]
    command: "cargo $foo"
    description: "Run various cargo subcommands/tools"

  #------------------------------------------------
  # This section is for _already_ implemented functionality
  #------------------------------------------------
  - name: db
    description: "Build the application dockerfile"
    command: "docker build . -t rox:local"

  - name: dr
    description: "Run 'help' for the packaged Docker application"
    command: "docker run rox:local"
    pre_targets: ["db"]
    
  - name: wr
    command: "cargo watch -c -x run"
    description: "Run the application, restarting on file changes"

  - name: clippy_ci
    command: "cargo clippy -D warnings"

  - name: clippy
    command: "cargo clippy"

  - name: test
    command: "cargo test"
    description: "Run tests"
    pre_targets: ["run"]
    post_targets: ["clippy"]

  - name: run
    description: "Runs the 'help' command as a basic test"
    command: "cargo run -h"

  - name: pc
    description: "All things to run before a commit"
    pre_targets: ["clippy", "test"] # It is valid to have no command if there are pre/post targets instead