Skip to content

Commit

Permalink
finish from support Restofile #5, add resto run command, update all
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Dec 19, 2021
1 parent b6c2268 commit 569c792
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ iwr -useb https://git.io/resto-win | iex
resto i https://get.docker.com
```

* Send a request from Restofile

```bash
resto run
# from path
resto run --file ./examples/basic_request/Restofile
```

### Flags

1. `GET` & `HEAD` flags
Expand Down
16 changes: 15 additions & 1 deletion cli/install/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Resto install command
## **Resto Install** command

> The `resto install` command is used to install binary app from script URL and run it.
Expand All @@ -9,3 +9,17 @@ resto i https://deno.land/x/install/install.sh

deno -V
```

### docs

#### flags

```bash
-s, --shell string shell to use default: bash
```

examples:

```bash
resto i https://deno.land/x/install/install.sh --shell sh
```
8 changes: 7 additions & 1 deletion cli/install/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ func InstallCMD() *cobra.Command {
},
}

cmd.Flags().StringVarP(&opts.Shell, "shell", "s", "", "shell to use")
p := "bash"

if runtime.GOOS == "windows" {
p = "powershell"
}

cmd.Flags().StringVarP(&opts.Shell, "shell", "s", "", "shell to use (Default: " + p + ")")

return cmd
}
Expand Down
39 changes: 39 additions & 0 deletions cli/run/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## **Resto Run** command

> The `resto run` command is used to run requests from `Restofile`
example of `Restofile`

```restofile
request {
method "POST"
url "https://api.spacex.land/graphql"
contentType "application/graphql"
}
body {
openBodyEditor "true"
# if `openBodyEditor` prop is false or not set
readFrom "examples/spacex.gql"
}
auth {
type "bearer"
token: "MY_TOKEN"
# or basic auth
type "basic"
username: "USERNAME"
password: "P@$$w0rd"
# to use from env variable
password "env:MY_PASSWORD"
}
```

examples:

```bash
resto run

# from file
resto run --file examples/basic_request/Restofile
```
Loading

0 comments on commit 569c792

Please sign in to comment.