ソースを参照

Merge branch 'master' into local-workflow

pull/21/head
Matt Baer 5年前
コミット
a98f507cfd
5個のファイルの変更41行の追加8行の削除
  1. +6
    -2
      GUIDE.md
  2. +4
    -0
      cmd/writeas/api.go
  3. +13
    -5
      cmd/writeas/cli.go
  4. +6
    -1
      cmd/writeas/commands.go
  5. +12
    -0
      debian/changelog

+ 6
- 2
GUIDE.md ファイルの表示

@@ -49,7 +49,7 @@ https://write.as/aaaaaaaaaaaa

This is generally more useful for posting terminal output or code, like so (the `--code` flag turns on syntax highlighting):

OS X / *nix: `cat writeas/cli.go | writeas --code`
macOS / Linux: `cat writeas/cli.go | writeas --code`

Windows: `type writeas/cli.go | writeas.exe --code`

@@ -64,7 +64,9 @@ Hello world!

#### List all published posts

This lists all posts you've published from your device. Pass the `--url` flag to show the list with full URLs.
This lists all posts you've published from your device.

Pass the `--url` flag to show the list with full post URLs, and the `--md` flag to return URLs with Markdown enabled.

```bash
$ writeas list
@@ -104,3 +106,5 @@ Customize your post's appearance with the `--font` flag:
| `code` | Syntax-highlighted monospace | No |

Put it all together, e.g. publish with a sans-serif font: `writeas new --font sans`

If you're publishing Markdown, supply the `--md` flag to get a URL back that will render Markdown, e.g.: `writeas new --font sans --md`

+ 4
- 0
cmd/writeas/api.go ファイルの表示

@@ -100,6 +100,10 @@ func DoPost(c *cli.Context, post []byte, font string, encrypt, tor, code bool) (
url = writeasBaseURL
}
url += "/" + p.ID
// Output URL in requested format
if c.Bool("md") {
url += ".md"
}
}

if cl.Token() == "" {


+ 13
- 5
cmd/writeas/cli.go ファイルの表示

@@ -18,7 +18,7 @@ const (

// Application constants.
const (
version = "1.2-dev"
version = "2.0-dev"
)

// Defaults for posts on Write.as.
@@ -47,6 +47,10 @@ var postFlags = []cli.Flag{
Usage: "Specifies this post is code",
},
cli.BoolFlag{
Name: "md",
Usage: "Returns post URL with Markdown enabled",
},
cli.BoolFlag{
Name: "verbose, v",
Usage: "Make the operation more talkative",
},
@@ -123,10 +127,10 @@ func main() {
Flags: postFlags,
},
{
Name: "publish",
Usage: "Publish a file to Write.as",
Action: cmdPublish,
Flags: postFlags,
Name: "publish",
Usage: "Publish a file to Write.as",
Action: cmdPublish,
Flags: postFlags,
},
{
Name: "delete",
@@ -216,6 +220,10 @@ func main() {
Usage: "Show list with post IDs (default)",
},
cli.BoolFlag{
Name: "md",
Usage: "Use with --url to return URLs with Markdown enabled",
},
cli.BoolFlag{
Name: "url",
Usage: "Show list with URLs",
},


+ 6
- 1
cmd/writeas/commands.go ファイルの表示

@@ -196,7 +196,12 @@ func cmdList(c *cli.Context) error {
if isDev() {
base = devBaseURL
}
fmt.Printf("%s/%s ", base, p.ID)
ext := ""
// Output URL in requested format
if c.Bool("md") {
ext = ".md"
}
fmt.Printf("%s/%s%s ", base, p.ID, ext)
}
fmt.Print("\n")
}


+ 12
- 0
debian/changelog ファイルの表示

@@ -1,3 +1,15 @@
writeas-cli (1.2) xenial; urgency=medium

* Add --md flag

-- Write.as <hello@write.as> Sat, 29 Sep 2018 12:15:27 -0400

writeas-cli (1.1+git20171119.dc1ab5b-1ubuntu1) xenial; urgency=medium

* Add --user-agent flag

-- Write.as <hello@write.as> Tue, 25 Sep 2018 13:02:41 -0400

writeas-cli (1.0+git20171119.dc1ab5b-1) xenial; urgency=medium

* All logging and errors go to stderr, not stdout (Closes: #11)


読み込み中…
キャンセル
保存