From 241c88127b42b5f65d04c600e3751e2538e73463 Mon Sep 17 00:00:00 2001 From: yusshu Date: Wed, 22 Mar 2023 18:26:30 -0500 Subject: [PATCH 1/2] ci: add 'build' GitHub actions workflow --- .github/workflows/build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..d7463400 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: 'Maven Package' + +on: [ 'push', 'pull_request' ] + +jobs: + build: + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B package --file pom.xml \ No newline at end of file From 7bd69d7f07286ecd8d960310f4f71e848747ef8d Mon Sep 17 00:00:00 2001 From: yusshu Date: Wed, 22 Mar 2023 18:27:44 -0500 Subject: [PATCH 2/2] docs: move some documentation from readme.md to docs/ Makes the README more consistent with other projects Uses the docs/ folder, so the documentation is shown at https://unnamed.team/docs/command-flow --- docs/getting-started.md | 25 +++++++++++++++++++++++++ docs/index.txt | 2 ++ docs/installation.md | 31 +++++++++++++++++++++++++++++++ readme.md | 41 +++++++---------------------------------- 4 files changed, 65 insertions(+), 34 deletions(-) create mode 100644 docs/getting-started.md create mode 100644 docs/index.txt create mode 100644 docs/installation.md diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 00000000..c88c9a17 --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,25 @@ +## Getting Started + +Welcome to the `command-flow` documentation + +CommandFlow is a flexible command framework which removes lots of +boilerplate code used in commands + +The command framework is divided into two parts. One is the actual +command framework and the other one is the API to allow creation of +a complete command tree based on annotations + +### Components of the Command Framework + +There are some basic components that you should at least be aware of to use **CommandFlow** +- **Command:** This is the most fundamental component, the **Command**. It contains all the information related to a command, included but not limited to name, aliases, permission, parts, etc. + Those are created using the `Command.builder(String)` method, which returns an `Command.Builder` instance where you can set all the information of the command. + +- **CommandPart:** This is the second most fundamental component, it can be understood as every argument of a **Command**, including things like subcommands, flags, non positional arguments, etc. It can use arguments from the argument list, or provide them using any other means also they can forward the parsing to another part and just act as a modifier. Most of the default parts can be found at the class `Parts` + +- **CommandContext**: This is a mutable object which contains the context for the called command including but not limited to the values for every part parsed, the raw arguments list and the raw arguments for every part, the labels and the Command execution path(which path of subcommands was taken). + + +### Known bugs or misbehaviours +The next list are the known bugs that must be resolved at some point: +- ~When using the FirstMatchPart in an ArgOrSub way(try to parse the arguments of the main command, if it fails try to parse the subcommand) with a main command with one argument(or more) and a subcommand that is optional, called with an unexistent subcommand, the main command will be called with no arguments, making it fail. The actual solution is to set the subcommand as required.~ diff --git a/docs/index.txt b/docs/index.txt new file mode 100644 index 00000000..039ce811 --- /dev/null +++ b/docs/index.txt @@ -0,0 +1,2 @@ +getting-started.md +installation.md \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..58808614 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,31 @@ +## Installation + +You can add `command-flow` to your project using [Gradle](https://gradle.org/), +[Maven](https://maven.apache.org/) or manually downloading the JAR files + +### Gradle +```kotlin +repositories { + maven("https://repo.unnamed.team/repository/unnamed-public/") +} +``` +```kotlin +dependencies { + implementation("me.fixeddev:commandflow-universal:0.5.3") +} +``` + +### Maven +```xml + + unnamed-public + https://repo.unnamed.team/repository/unnamed-public/ + +``` +```xml + + me.fixeddev + commandflow-universal + 0.5.3 + +``` \ No newline at end of file diff --git a/readme.md b/readme.md index 4c5e60b0..45067afe 100644 --- a/readme.md +++ b/readme.md @@ -1,36 +1,9 @@ -# CommandFlow -A flexible command framework which removes lots of boilerplate code used in commands. +# command-flow +[![Build Status](https://img.shields.io/github/actions/workflow/status/unnamed/command-flow/build.yml?branch=master)](https://github.com/unnamed/command-flow/actions/workflows/build.yml) +[![MIT License](https://img.shields.io/badge/license-MIT-blue)](license.txt) +[![Discord](https://img.shields.io/discord/683899335405994062)](https://discord.gg/xbba2fy) -## Usage -The command framework is divided into two parts. One is the actual command framework and the other one is the API to allow creation of a complete command tree based on annotations. -### Components of the Command Framework +A flexible command framework which removes lots of boilerplate code used in commands -There are some basic components that you should at least be aware of to use **CommandFlow** -- **Command:** This is the most fundamental component, the **Command**. It contains all the information related to a command, included but not limited to name, aliases, permission, parts, etc. -Those are created using the `Command.builder(String)` method, which returns an `Command.Builder` instance where you can set all the information of the command. - -- **CommandPart:** This is the second most fundamental component, it can be understood as every argument of a **Command**, including things like subcommands, flags, non positional arguments, etc. It can use arguments from the argument list, or provide them using any other means also they can forward the parsing to another part and just act as a modifier. Most of the default parts can be found at the class `Parts` - -- **CommandContext**: This is a mutable object which contains the context for the called command including but not limited to the values for every part parsed, the raw arguments list and the raw arguments for every part, the labels and the Command execution path(which path of subcommands was taken). - -### Maven -#### Repository: -```xml - - unnamed-public - https://repo.unnamed.team/repository/unnamed-public/ - -``` - -#### Dependency: -```xml - - me.fixeddev - commandflow-universal - 0.5.3 - -``` - -## Known bugs or misbehaviours -The next list are the known bugs that must be resolved at some point: -- ~When using the FirstMatchPart in an ArgOrSub way(try to parse the arguments of the main command, if it fails try to parse the subcommand) with a main command with one argument(or more) and a subcommand that is optional, called with an unexistent subcommand, the main command will be called with no arguments, making it fail. The actual solution is to set the subcommand as required.~ +Check the [documentation](https://unnamed.team/docs/creative) for installation and +usage information for this project \ No newline at end of file