Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanguage committed Sep 16, 2022
1 parent 0d7be84 commit 329b12a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
41 changes: 41 additions & 0 deletions docs/wrap_cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Wrap command line

Another way to use oneFace is to wrap a command line program.
From the perspective of implementation, it's a layer of wrapping
around the oneFace API. You can use a YAML configuration file to
describe the command line to be wrapped and the type, range and default
value of each parameter.

Here is an example YAML file:

```YAML
# example.yaml
# The name of your app
name: add

# The target command to be wraped.
# Use '{}' to mark all arguments.
command: python -c "print({a} + {b})"

# List all argument's type and range
arguments:

a:
type: int
range: [0, 10]

b:
type: int
range: [-10, 10]
default: 0

# Interface specific config
# These parameters will pass to the interface
qt_config:
# qt related config
run_once: false

dash_config:
# Dash related config
console_interval: 2000
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ nav:
- Interface configuration:
- Qt configs: qt_confs.md
- Dash configs: dash_confs.md
- Wrap command line: wrap_cli.md

markdown_extensions:
- pymdownx.highlight:
Expand Down
2 changes: 0 additions & 2 deletions oneface/wrap_cli/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ arguments:
range: [-10, 10]
default: 0


# Interface specific config
# These parameters will pass to the interface
qt_config:
Expand All @@ -27,4 +26,3 @@ qt_config:
dash_config:
# Dash related config
console_interval: 2000

0 comments on commit 329b12a

Please sign in to comment.