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

Commit

Permalink
Merge pull request #59 from AntelopeIO/remove-positional-api
Browse files Browse the repository at this point in the history
remove positional arguments from CLI
  • Loading branch information
dimas1185 authored May 11, 2023
2 parents 2034b9a + 937436e commit 627a7e1
Show file tree
Hide file tree
Showing 16 changed files with 348 additions and 220 deletions.
112 changes: 68 additions & 44 deletions docs/man/antler-proj.1
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
.\" Automatically generated by Pandoc 2.9.2.1
.\" Automatically generated by Pandoc 3.1.2
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "antler-proj" "1" "March 09, 2023" "antler-proj 1.0.0" "User Manual"
.hy
.SH NAME
.PP
antler-proj - Antler Project Management System
.SH SYNOPSIS
.PP
\f[C]antler-proj <command> [<args>]\f[R]
\f[V]antler-proj <command> [<args>]\f[R]
.SH DESCRIPTION
.PP
\f[B]Antler Project Management System\f[R] is a set of libraries and
Expand All @@ -17,34 +31,31 @@ tools to help users successfully develop smart contracts.
This is a general help text which prints when antler-proj runs without a
command or with key \[em]help.
.PP
\f[B]Example: \f[CB]antler-proj --help\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj --help\f[B]\f[R]
.PP
Each command has its own help which prints when the command runs with
key \[em]help.
.PP
\f[B]Example: \f[CB]antler-proj init --help\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj init --help\f[B]\f[R]
.PP
Below is described a full list of all possible commands and their
possible arguments
.PP
\f[B]init\f[R] command creates a new project.
Creating the directory tree, a \f[C]project.yaml\f[R] file and
Creating the directory tree, a \f[V]project.yaml\f[R] file and
initializes it.
.IP
.nf
\f[C]
Command arguments:
<path> Path to the root of the project. Here a \[ga]project.yaml\[ga] file will be created
<project_name> Name of the project
[version] Version of the project. Default version is 0.0.1
-h,--help Print this help message and exit
-p <path> Path to the root of the project.
-n <project_name> The name of the project.
-v <version> The version to store in the project file.
-p,--path Path to the root of the project. Here a \[ga]project.yaml\[ga] file will be created. Default is ./<name>.
-n,--name The name of the project.
-v,--version The version to store in the project file. Default version is 0.0.1
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj init ./project hello_world 0.1\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj init hello_world 0.1\f[B]\f[R]
.PP
\f[B]add\f[R] command adds an app, dependency, library or test to your
project.
Expand All @@ -53,13 +64,12 @@ project.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yaml\[ga] or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj add ./project app\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj add app\f[B]\f[R]
.PP
\f[B]update\f[R] command updates an app, dependency, library or test to
your project.
Expand All @@ -68,13 +78,12 @@ your project.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yaml\[ga] or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj update ./project app\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj update app\f[B]\f[R]
.PP
\f[B]remove\f[R] command removes an app, dependency, library or test
from your project.
Expand All @@ -83,17 +92,16 @@ from your project.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yaml\[ga] or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj remove ./project app\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj remove app\f[B]\f[R]
.PP
\f[B]populate\f[R] command loads existing information about the project
starting from the root project.yaml file as described in the chapter
\f[C]\[dq]Loading of a project\[dq]\f[R] in the User\[cq]s guide.
\f[V]\[dq]Loading of a project\[dq]\f[R] in the User\[cq]s guide.
.IP
.nf
\f[C]
Expand All @@ -106,12 +114,11 @@ Downloads all the updates in a way depending on where it is located.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yml\[ga] or the path containing it. Default is current directory.
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj populate ./project\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj populate\f[B]\f[R]
.PP
\f[B]validate\f[R] command performs a check of the project to ensure
that all data that describes the project is correct.
Expand All @@ -130,12 +137,12 @@ exist and if it is possible to download all remote dependencies.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yml\[ga] or the path containing it. Default is current directory.
-V,--verbose Verbose output.
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj validate ./project\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj validate\f[B]\f[R]
.PP
\f[B]build\f[R] command builds all applications described in the
project.yaml, their dependencies and tests.
Expand All @@ -144,32 +151,49 @@ project.yaml, their dependencies and tests.
\f[C]
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the \[ga]project.yml\[ga] or the path containing it. Default is current directory.
\f[R]
.fi
.PP
\f[B]Example: \f[CB]antler-proj build ./project\f[B]\f[R]
\f[B]Example: \f[VB]antler-proj build\f[B]\f[R]
.PP
\f[B]\f[CB]--version\f[B]\f[R] Returns the version of antler-proj
application \f[B]Example: \f[CB]antler-proj --version\f[B]\f[R]
\f[B]\f[VB]--version\f[B]\f[R] Returns the version of antler-proj
application \f[B]Example: \f[VB]antler-proj --version\f[B]\f[R]
.SH EXAMPLES
.IP
.nf
\f[C]
antler-proj add app MyApp C++ \[rs]\[rs]-O2
antler-proj add app -n MyApp -l C++ \[dq]\[rs]-O2 -WError\[dq] \[rs]\[rs]-s
antler-proj add lib MyLib C++ \[rs]\[rs]-O2 \[dq]\[rs]-s\[dq]
antler-proj add dep MyApp MyDep
antler-proj add app -n MyApp -l C++ --comp \[rs]\[rs]-O2
antler-proj add app --name MyApp --langl C++ --comp \[rs]\[rs]-O2
antler-proj add app -n MyApp -l C++ --comp \[dq]\[rs]-O2 -WError\[dq] --limk \[rs]\[rs]-s
antler-proj add app --name MyApp --lang C++ --comp \[dq]\[rs]-O2 -WError\[dq] --limk \[rs]\[rs]-s
antler-proj add lib -n MyLib -l C++ --comp \[rs]\[rs]-O2 --link \[dq]\[rs]-s\[dq]
antler-proj add lib --name MyLib --lang C++ --comp \[rs]\[rs]-O2 --link \[dq]\[rs]-s\[dq]
antler-proj add dep -o MyApp -d MyDep
antler-proj add dep --obj_name MyApp --dep_name MyDep

antler-proj build -j3
antler-proj init MyProjectName 1.0.0
antler-proj populate ./path-to-project
antler-proj remove app MyApp
antler-proj remove lib MyLib
antler-proj remove dep MyDep MyApp
antler-proj update app MyApp C++ \[rs]\[rs]-O2
antler-proj update lib MyLib C++ \[rs]\[rs]-O2 \[dq]\[rs]-s\[dq]
antler-proj update dep MyDep -l AntelopeIO/my_dep
antler-proj build --jobs 3

antler-proj init -n MyProjectName -v 1.0.0
antler-proj init --name MyProjectName --version 1.0.0

antler-proj populate -p ./path-to-project
antler-proj populate --path ./path-to-project

antler-proj remove app -n MyApp
antler-proj remove app --name MyApp
antler-proj remove lib -n MyLib
antler-proj remove lib --name MyLib
antler-proj remove dep -d MyDep -o MyApp
antler-proj remove dep --dep_name MyDep --obj_name MyApp

antler-proj update app -n MyApp -l C++ --comp \[rs]\[rs]-O2
antler-proj update app --name MyApp --lang C++ --comp \[rs]\[rs]-O2
antler-proj update lib -n MyLib -l C++ --comp \[rs]\[rs]-O2 --link \[dq]\[rs]-s\[dq]
antler-proj update lib --name MyLib --lang C++ --comp \[rs]\[rs]-O2 --link \[dq]\[rs]-s\[dq]
antler-proj update dep -u https://github.com/AntelopeIO/my_dep
antler-proj update dep --to MyApp --name MyDepCustomName --url https://github.com/AntelopeIO/my_dep
antler-proj validate
\f[R]
.fi
Expand Down
82 changes: 46 additions & 36 deletions docs/man/antler-proj.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,45 @@ Below is described a full list of all possible commands and their possible argum

```
Command arguments:
<path> Path to the root of the project. Here a `project.yaml` file will be created
<project_name> Name of the project
[version] Version of the project. Default version is 0.0.1
-h,--help Print this help message and exit
-p <path> Path to the root of the project.
-n <project_name> The name of the project.
-v <version> The version to store in the project file.
-p,--path Path to the root of the project. Here a `project.yaml` file will be created. Default is ./<name>.
-n,--name The name of the project.
-v,--version The version to store in the project file. Default version is 0.0.1
```
**Example: `antler-proj init ./project hello_world 0.1`**
**Example: `antler-proj init hello_world 0.1`**


**add** command adds an app, dependency, library or test to your project.

```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the `project.yaml` or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
```
**Example: `antler-proj add ./project app`**
**Example: `antler-proj add app`**


**update** command updates an app, dependency, library or test to your project.

```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the `project.yaml` or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
```
**Example: `antler-proj update ./project app`**
**Example: `antler-proj update app`**


**remove** command removes an app, dependency, library or test from your project.

```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the `project.yaml` or the path containing it. Default is current directory.
<app,lib,dep> Type of an entity to work with
```
**Example: `antler-proj remove ./project app`**
**Example: `antler-proj remove app`**


**populate** command loads existing information about the project starting from the root project.yaml file as described in the chapter `"Loading of a project"` in the User's guide.
Expand All @@ -87,10 +81,9 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the `project.yml` or the path containing it. Default is current directory.
```
**Example: `antler-proj populate ./project`**
**Example: `antler-proj populate`**

**validate** command performs a check of the project to ensure that all data that describes the project is correct.

Expand All @@ -103,20 +96,19 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> Path to the root of the project.
-p,--path This must be the path to the `project.yml` or the path containing it. Default is current directory.
-V,--verbose Verbose output.
```
**Example: `antler-proj validate ./project`**
**Example: `antler-proj validate`**

**build** command builds all applications described in the project.yaml, their dependencies and tests.

```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
[path] Path to the root of the project.
-p,--path This must be the path to the `project.yml` or the path containing it. Default is current directory.
```
**Example: `antler-proj build ./project`**
**Example: `antler-proj build`**


**`--version`** Returns the version of antler-proj application
Expand All @@ -125,19 +117,37 @@ Command arguments:
# EXAMPLES

```
antler-proj add app MyApp C++ \\-O2
antler-proj add app -n MyApp -l C++ "\-O2 -WError" \\-s
antler-proj add lib MyLib C++ \\-O2 "\-s"
antler-proj add dep MyApp MyDep
antler-proj add app -n MyApp -l C++ --comp \\-O2
antler-proj add app --name MyApp --langl C++ --comp \\-O2
antler-proj add app -n MyApp -l C++ --comp "\-O2 -WError" --limk \\-s
antler-proj add app --name MyApp --lang C++ --comp "\-O2 -WError" --limk \\-s
antler-proj add lib -n MyLib -l C++ --comp \\-O2 --link "\-s"
antler-proj add lib --name MyLib --lang C++ --comp \\-O2 --link "\-s"
antler-proj add dep -o MyApp -d MyDep
antler-proj add dep --obj_name MyApp --dep_name MyDep
antler-proj build -j3
antler-proj init MyProjectName 1.0.0
antler-proj populate ./path-to-project
antler-proj remove app MyApp
antler-proj remove lib MyLib
antler-proj remove dep MyDep MyApp
antler-proj update app MyApp C++ \\-O2
antler-proj update lib MyLib C++ \\-O2 "\-s"
antler-proj update dep MyDep -l AntelopeIO/my_dep
antler-proj build --jobs 3
antler-proj init -n MyProjectName -v 1.0.0
antler-proj init --name MyProjectName --version 1.0.0
antler-proj populate -p ./path-to-project
antler-proj populate --path ./path-to-project
antler-proj remove app -n MyApp
antler-proj remove app --name MyApp
antler-proj remove lib -n MyLib
antler-proj remove lib --name MyLib
antler-proj remove dep -d MyDep -o MyApp
antler-proj remove dep --dep_name MyDep --obj_name MyApp
antler-proj update app -n MyApp -l C++ --comp \\-O2
antler-proj update app --name MyApp --lang C++ --comp \\-O2
antler-proj update lib -n MyLib -l C++ --comp \\-O2 --link "\-s"
antler-proj update lib --name MyLib --lang C++ --comp \\-O2 --link "\-s"
antler-proj update dep -u https://github.com/AntelopeIO/my_dep
antler-proj update dep --to MyApp --name MyDepCustomName --url https://github.com/AntelopeIO/my_dep
antler-proj validate
```

Expand Down
Loading

0 comments on commit 627a7e1

Please sign in to comment.