hedgedoc / cli

A tiny CLI for HedgeDoc
GNU Affero General Public License v3.0
150 stars 37 forks source link

Output just URL of imported note #33

Closed davidak closed 4 years ago

davidak commented 4 years ago

According to the unix philosophy, you should be able to pipe the output of a tool into another. With the output of this script, it is not possible.

The actual output of ./codimd import test.md is

Found. Redirecting to https://pad.nixnet.services/gNvbypueQ6awH73V3nx_jw

(don't forget to update usage information when this is changed)

Workaround

Use awk to manipulate the text:

./codimd import test.md | awk '{print $4}'
https://pad.nixnet.services/zKOoDxhQTuaT4dnJAybrfw
pirate commented 4 years ago

This is a bug, not an intentional design, see #31.

It's supposed to return just the note ID, then the user can get the url from that themselves by concatenating it with $CODIMD_SERVER.