Blame SOURCES/genmanpages.sh

62780e
#!/bin/sh
62780e
62780e
rm -rf man
62780e
mkdir -p man/etcdctl2 man/etcdctl3
62780e
pushd man/etcdctl3
62780e
ETCDCTL_API=3 ../../$1/bin/etcdctl --help
62780e
62780e
# rename to etcdctl3...
62780e
for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl3/"); done
62780e
62780e
# rename refs
62780e
sed -i "s/\\\fBetcdctl\\\-/\\\fBetcdctl3\\\-/g" *.1
62780e
62780e
# stress ETCDCTL_API use
62780e
sed -i s"/^\\\fBetcdctl /\\\fBETCDCTL=3 etcdctl /" etcdctl3*.1
62780e
62780e
cd ../etcdctl2
62780e
../../$1/bin/etcdctl --help > etcdctl.1
62780e
62780e
for cmd in $(cat etcdctl.1 | grep "\fBetcdctl\\\-" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done
62780e
62780e
# rename to etcdctl2
62780e
for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl2/"); done
62780e
62780e
# rename refs
62780e
sed -i "s/\\\fBetcdctl\\\-/\\\fBetcdctl2\\\-/g" *.1
62780e
62780e
cd ..
62780e
mv etcdctl2/* .
62780e
mv etcdctl3/* .
62780e
rm -rf etcdctl2 etcdctl3
62780e
cp ../etcdctl.1 .
62780e
62780e
# Gen etcd.1
62780e
../$1/bin/etcd --help > etcd.1