浏览代码

Add --help

master
JustAnotherArchivist 3 年前
父节点
当前提交
821cacf626
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      parent-urls

+ 7
- 0
parent-urls 查看文件

@@ -1,4 +1,11 @@
#!/bin/bash
if [[ "$1" == '--help' || "$1" == '-h' ]]
then
echo "Usage: parent-urls [--with-original]" >&2
echo "Take URLs on stdin, remove path components one by one and print the resulting URLs on stdout." >&2
echo "If --with-original is given, the input URL is printed before the parents." >&2
fi

prog0='BEGIN { FS="/"; OFS="/" }' # Set the field separators
prog1='{ print }' # Print the input URL (if desired)
prog2='/\/$/ { --NF }' # Remove the trailing blank field if the URL ends with a slash


正在加载...
取消
保存