Skip to content

Commit f27ace9

Browse files
committed
Examples.
1 parent 0e781e6 commit f27ace9

4 files changed

Lines changed: 28 additions & 3 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
**.swp
55
tags
66
/*.sublime-*
7-
/bin/dev
87
/etc/dev.conf
98
/src
109
/usr

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ Create a configuration file:
4343
cp ~/dev/etc/dev.conf.example ~/dev/etc/dev.conf
4444
```
4545

46-
The installation is complete, enter `dev --help` at the command line to see how to use it.
47-
4846
If you want to use the command auto completion, run the following command:
4947

5048
```sh
5149
cat ~/dev/share/completion.bash >> ~/.bash_completion
5250
```
5351

52+
The installation is complete, enter `dev --help` at the command line to see how to use it.
53+
5454
## Usage
5555

5656
```sh
@@ -64,6 +64,20 @@ file, **cmd-function** is prefixed with *cmd_*.
6464

6565
## Example
6666

67+
Type the folloing command:
68+
69+
```sh
70+
dev examples/example helloworld
71+
```
72+
73+
Output:
74+
75+
```sh
76+
Hello world!
77+
```
78+
79+
## Custom Command Example
80+
6781
Create a new command to copy the following text to the file ~/dev/cmd/demo.bash:
6882

6983
```sh
@@ -78,6 +92,12 @@ And then type the following command to run:
7892
dev demo helloworld
7993
```
8094

95+
Output:
96+
97+
```sh
98+
Hello world!
99+
```
100+
81101
In the above command, **demo** is cmd-file. **helloworld** is cmd-function.
82102

83103
> You can save all project-related commands in the cmd directory.

bin/dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
dev-bootstrap dev $@

cmd/examples/example.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
dev_import dev file
66

77
cmd_helloworld() {
8+
echo "Hello World!"
9+
}
10+
11+
cmd_sleep() {
812
echo "$(whoami)"
913
for i in `seq 1 3`; do
1014
sleep 1

0 commit comments

Comments
 (0)