Par Paragraph Formatter - 如何在 Windows 命令行中使用它
Par Paragraph Formatter - How to use it in the Windows Command Line
有一个非常聪明和有用的段落格式器 par
(par website)。我已经将它与 Vim 一起使用,效果很好。我想在 Windows 命令行中使用它。 (我正在使用 Windows 7)。但是我收到 par error: bad argument
错误。如何在 windows 命令提示符 中使用 par。我已经在我的路径中找到它,所以它确实找到了它并且还为我提供了帮助内容。但是当我向它传递一个长文本流时,我无法弄清楚为什么它会出错。
(因为,开发者网站上有一个 par.exe
。我很确定它可以在 Windows 上运行。)
我试过的是:
par w30 "This is a long long paragraph. Please shorten it to 30 characters per line. But it does not work."
par 30j "This is a long long paragraph. Please shorten it to 30 characters per line and also justify the text. But it does not work."
我已经成功地将它与 Vim 一起使用,效果很好。请帮忙。
我认为输入必须通过管道传输到工具中,而不是作为参数传递。所以对于你的例子,试试这个:
echo This is a long long paragraph. Please shorten it to 30 characters per line. But it does not work.| par w30
echo This is a long long paragraph. Please shorten it to 30 characters per line and also justify the text. But it does not work.| par 30j
有一个非常聪明和有用的段落格式器 par
(par website)。我已经将它与 Vim 一起使用,效果很好。我想在 Windows 命令行中使用它。 (我正在使用 Windows 7)。但是我收到 par error: bad argument
错误。如何在 windows 命令提示符 中使用 par。我已经在我的路径中找到它,所以它确实找到了它并且还为我提供了帮助内容。但是当我向它传递一个长文本流时,我无法弄清楚为什么它会出错。
(因为,开发者网站上有一个 par.exe
。我很确定它可以在 Windows 上运行。)
我试过的是:
par w30 "This is a long long paragraph. Please shorten it to 30 characters per line. But it does not work."
par 30j "This is a long long paragraph. Please shorten it to 30 characters per line and also justify the text. But it does not work."
我已经成功地将它与 Vim 一起使用,效果很好。请帮忙。
我认为输入必须通过管道传输到工具中,而不是作为参数传递。所以对于你的例子,试试这个:
echo This is a long long paragraph. Please shorten it to 30 characters per line. But it does not work.| par w30
echo This is a long long paragraph. Please shorten it to 30 characters per line and also justify the text. But it does not work.| par 30j